PDA

View Full Version : Configure uses -lQtCore and -lQtGui while only -lQtCore4 and -lQtGui4 exist



Daevius
8th October 2011, 10:39
Cannot find -lQtCore
Cannot find -lQtGui

Is reported when compiling src/tools/idc/main.cpp

Which is correct, since in lib indeed libQtCore.a and libQtGui.a are not existing. But libQtCore4.a and libQtGui4.a DO exist.
I assume the '4' version must be used? How would I make this change?

Editing IDC's makefile doesn't work, since it's generated by configure prior to the error.
Do I need to edit a .pro file? Which one!

Thanks.

PS: I'm statically compiling Qt

wysota
8th October 2011, 15:42
Please tell us step by step what you did.

Daevius
8th October 2011, 17:20
I downloaded the latest Qt Libraries package (qt-win-opensource-4.7.4-mingw) and ran configure.exe with the following command parameters:

configure -prefix e:\SDK\Qt\4.7.4\ -platform win32-g++ -xplatform win32-g++ -static -release -opensource -confirm-license -phonon -qt-zlib -qt-libpng -qt-libjpeg -no-libtiff -no-libmng -no-openssl -nomake examples -nomake demos -nomake docs -no-webkit -no-script -no-scripttools -no-declarative -no-s60 -no-qt3support -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -qt-style-windowsvista

This is a static release compilation using g++ (g++-dw2) from the TDM-GCC package.
When running a lot goes well, but this error message is produced by LD:


mingw32-make[2]: Entering directory `E:/SDK/Qt/4.7.4/src/tools/idc'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE
_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\include\QtC
ore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQ
t" -I"tmp\moc\release_static" -I"..\..\..\mkspecs\win32-g++" -o tmp\obj\release_
static\main.o main.cpp
g++ -Wl,-s -Wl,-subsystem,console -mthreads -o ..\..\..\bin\idc.exe tmp/obj/rele
ase_static/main.o -L"e:\SDK\Qt\4.7.4\lib" -L"e:\SDK\Qt\4.7.4\lib" -lQtGui -lgdi
32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -
luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
e:/compilers/tdm/bin/../lib/gcc/mingw32/4.6.1-dw2/../../../../mingw32/bin/ld.exe
: cannot find -lQtGui
e:/compilers/tdm/bin/../lib/gcc/mingw32/4.6.1-dw2/../../../../mingw32/bin/ld.exe
: cannot find -lQtCore
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\..\bin\idc.exe] Error 1
mingw32-make[2]: Leaving directory `E:/SDK/Qt/4.7.4/src/tools/idc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `E:/SDK/Qt/4.7.4/src/tools/idc'
mingw32-make: *** [sub-idc-make_default] Error 2
Building src/tools failed, return code 2

And indeed. The libraries it tries to link do not exist in the 'lib' directory.
Only the .prl files with that name exist.

wysota
8th October 2011, 18:04
I suggest you download the source-only bundle, unpack it outside the sdk branch and configure there.

Daevius
8th October 2011, 20:10
Downloaded qt-everywhere-opensource-src-4.7.4, but it's giving the exact same error.
It's not that GCC has a version too high? Or that I forgot a step?

In fact, the lib directory contains no library files whats-o-ever at the point it tries to configure / build IDC.

How is this _supposed_ to work?
Why does configure need the libraries that configure configures for, and the make command should be building afterwards.
Sounds weird to me...chicken-egg problem.

Thanks for your help so far though ;)

Daevius
8th October 2011, 23:10
Did 2 things (not sure which fixed it):

Added -no-exceptions to the configure command line. And in mkspecs/win32-g++/qmake.conf set:
QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc

Configures now. It didn't even went compiling source files after generating the makefiles from the .pro files (which it did before and caused the error).