PDA

View Full Version : compilation error



jjbabu
8th April 2009, 11:23
Talk2amulya,
i added those .prf files to my makefile and i compiled that application still it is giving same error. what might be the problem?

Actualy i tried to give reply directly with ur last post but i am not able to write on the site,so i created new thread.plz excuse me.

thank u.

spirit
8th April 2009, 11:26
did you try to install Qt in another directory/drive etc?

jjbabu
8th April 2009, 11:30
just now i am trying to do that.i will let u know after installing qt on another drive Spirit.

thank u.

jjbabu
8th April 2009, 14:45
Spirit,
Even after installing on different directory is also creating same problem.


tmp/obj/debug_shared/hello.o(.text+0x158): In function `Z5qMainiPPc':
F:/Qt/4.4.3/hello/hello.cpp:5: undefined reference to `_imp___ZN12QApplicationC1
ERiPPci'
tmp/obj/debug_shared/hello.o(.text+0x1ec):F:/Qt/4.4.3/hello/hello.cpp:6: undefin
ed reference to `_imp___ZN6QLabelC1ERK7QStringP7QWidget6QFlagsIN2Q t10WindowTypeE
E'
tmp/obj/debug_shared/hello.o(.text+0x2b2):F:/Qt/4.4.3/hello/hello.cpp:8: undefin
ed reference to `_imp___ZN12QApplication4execEv'
tmp/obj/debug_shared/hello.o(.text+0x2cf):F:/Qt/4.4.3/hello/hello.cpp:8: undefin
ed reference to `QApplication::~QApplication()'
tmp/obj/debug_shared/hello.o(.text+0x2fe):F:/Qt/4.4.3/hello/hello.cpp:8: undefin
ed reference to `QApplication::~QApplication()'
tmp/obj/debug_shared/hello.o(.text$_ZN7QStringD1Ev[QString::~QString()]+0x20): I
n function `ZSt3minIjERKT_S2_S2_':
F:/Qt/4.4.3/hello/../include/QtCore/../../src/corelib/tools/qstring.h: undefined
reference to `_imp___ZN7QString4freeEPNS_4DataE'
tmp/obj/debug_shared/hello.o(.text$_ZN7QStringC1EPKc[QString::QString(char const
*)]+0x19):F:/Qt/4.4.3/hello/../include/QtCore/../../src/corelib/tools/qstring.h:
undefined reference to `_imp___ZN7QString16fromAscii_helperEPKci'
/mingw/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `Win
Main@16'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\hello.exe] Error 1
mingw32-make[1]: Leaving directory `F:/Qt/4.4.3/hello'
mingw32-make: *** [debug-all] Error 2


this is the problem,what should i do?

spirit
8th April 2009, 14:51
did you try to build Qt's examples?

jjbabu
8th April 2009, 15:05
Spirit,
I am trying to compile this simple code:

#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}


this simple application is not compiling then how can i expect examples will compile properly.

spirit
8th April 2009, 15:07
so, I would like to know: did you build Qt manually or installed already built Qt?

jjbabu
8th April 2009, 15:13
I have not understood ur question properly.what i did is i uninstalled previously installed qt and again i installed qt in "F" directory by specifying MinGw path in sam "F" directory only.as i am windows user simply followed the instructions which i got after double clicking the qt software.

spirit
8th April 2009, 15:15
got it. so, try to build Qt by yourself using Qt's configure tool.

jjbabu
8th April 2009, 15:32
how to do that?
Can u specify steps involved on that configuration?

spirit
8th April 2009, 15:36
read this (http://doc.trolltech.com/4.5/installation.html) and also INSTALL file in QTDIR.

jjbabu
8th April 2009, 15:54
i just configured qt and tried again by compiling application,still problem not rectified.

spirit
8th April 2009, 15:58
do mingw32-make clean and then repeat configure process.
and also check your QTDIR, QMAKESPEC, INCLUDE, LIB and PATH variable they mast containt correct values.

jjbabu
9th April 2009, 06:37
How to do mingw-32-make clean?
I think these r the steps i need to follow:
After open the Qt command prompt, i just need to enter "mingw-32-make clean".
once the above step has been finished i have to give "configure" again.

Am i correct spirit or is there any thing else?

spirit
9th April 2009, 07:11
yes, this should be enough.

jjbabu
9th April 2009, 07:30
I have done what u mentioned in ur last post spirit.
These are my directories setting to the paths:

Setting up a MinGW/Qt only environment...
-- QTDIR set to F:\Qt\4.4.3
-- PATH set to F:\Qt\4.4.3\bin
-- Adding F:\MinGW\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++

still the example is not compiling?

note: while configuring my qt, i got on pop up from my system that states qmake.exe file is corrupted and it is unreadable. What does it mean.

As u told i am installing my QT on "F" directory.

spirit
9th April 2009, 07:43
okay, try to rebuild qmake, go to QTDIR/qmake and run mingw32-make.
btw, after Qt configuration you had to run mingw32-make. did you do this? only after that process of building will be started and it takes from 1 to 5 hours (the compilation time depents of your hardware configuration).
PS. if you will not reach successful result I'll record a video man for you how to build Qt. :)

jjbabu
9th April 2009, 07:57
after giving "mingw32-make" in QTDIR/qmake,the response is this:

mingw32-make: `qmake.exe' is up to date.

now i gave mingw32-make in my QTDIR, as per ur last post it may take 5hrs time,Am i right spirit?

one more thing spirit,
When i installed QT 2months back in my previous company,I have not followed these many steps.Simply installing MINGW and installed qt by double clicking on software.then i executed example and even i developed projects also.But now i shifted to another company and i am trying to execute simple code it is not working properly.
you are telling so many steps to work QT properly,Do you know what is the problem spirit.
I think the problem is related to OS or system related, Am i right or not?

jjbabu
9th April 2009, 07:59
Spirit,
i got these error when i gave "mingw32-make" command:


F:/Qt/4.4.3/src/corelib/io/qfsfileengine_win.cpp:1449: undefined reference to `C
oCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 2b2):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 2e0):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 307):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 49b):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 4dc):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 4fb):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 52c):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 553):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 7d8):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 829):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 848):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 879):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa 8a0):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa a37):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa a78):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa a97):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa ac8):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa aef):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa df3):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1449: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa f38): In function `ZN13QFSFi
leEngine4linkERK7QString':
F:/Qt/4.4.3/src/corelib/io/qfsfileengine_win.cpp:1556: undefined reference to `C
oCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa f57):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xa f85):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 1e1):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 289):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 35c):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 37b):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 3a9):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb 92b):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb b0b):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb bb7):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb bd6):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb c04):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb e92):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xb f3a):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xc 00d):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xc 02c):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xc 05a):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xc 5dc):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0xc 960):F:/Qt/4.4.3/src/corelib
/io/qfsfileengine_win.cpp:1556: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\quuid.o(.text+0x22e3): In function `ZN5QUuid10createUuidE
v':
F:/Qt/4.4.3/src/corelib/plugin/quuid.cpp:566: undefined reference to `CoCreateGu
id@4'
./tmp\obj\debug_shared\qeventdispatcher_win.o(.text+ 0x2ac5): In function `ZN28QE
ventDispatcherWin32Private16doWsaAsyncSelectEi':
F:/Qt/4.4.3/src/corelib/kernel/qeventdispatcher_win.cpp:619: undefined reference
to `WSAAsyncSelect@16'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\QtCored4.dll] Error 1
mingw32-make[2]: Leaving directory `F:/Qt/4.4.3/src/corelib'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `F:/Qt/4.4.3/src/corelib'
mingw32-make: *** [sub-corelib-make_default-ordered] Error 2

spirit
9th April 2009, 08:03
Am i right spirit?

I said, it depends of you system. on my system build process takes 1h 15m.



Do you know what is the problem spirit.

I don't know, that's why I suggest you to build Qt manually.



I think the problem is related to OS or system related, Am i right or not?

I'm not sure.
again if after rebuilding Qt you will have the same problem, then maybe something wrong with you system, but doubt that it connects with system.

btw, I never use intallation of Qt, I always build it by myself.