Problems creating Qt 4.6.3 static with MinGw
Hi,
I'm trying to compile Qt 4.6.3 as static libraries. The compilation is working well without errors. When I try to compile my Qt application against this library, following linker error occurs:
d:/Programme/Qt/4.6.3-static/lib\libQtGui.a(qapplication.o):qapplication.cpp: (.text+0x87e2): undefined reference to _imp___Z21qt_call_post_routinesv'
d:/Programme/Qt/4.6.3-static/lib\libQtGui.a(qwhatsthis.o):qwhatsthis.cpp: (.text+0x1664): undefined reference to
_imp___Z21qDeleteInEventHandlerP7QObject'
It seems to me libQtGui and libQtCore have dependencies in both ways.
Here's the way I configured my Qt static library:
configure.exe -static -release -opensource -no-exceptions -no-accessibility -no-qt3support -plugin-sql-odbc -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -no-dsp -no-vcproj -no-incredibuild-xge -no-openssl -no-dbus -no-phonon -no-webkit -script -scripttools -arch windows -mmx -sse -sse2 -3dnow -qt-style-windows -qt-style-windowsxp
-qt-style-windowsvista
I compiled/configured Qt 4.6.2 the same way and it was working. Im running Win2K, MSys console, MinGw GCC 4.5.0 (also tried MinGw GCC 4.4.0 deliverd with Qt 4.6.3)
When I google the linker error I only find 2 entries. One in a russion forum with the same problem and one in Qt bugreports hen using Qt 4.7 without -no-qt3support.
Can someone help me please ?
Re: Problems creating Qt 4.6.3 static with MinGw
Hi,
- I can confrim I have the same problem with 4.6.3, and that was ok with 4.6.2.
- If you compile the lib with qt3-support, then the libs are not compiling. If you compile with -no-qt3support, then the libs are ok, but compiling any application has the same error (undefined reference to _imp___Z21qt_call_post_routinesv' ...)
- I tried with VS2008, also static release, and it seems ok.
Re: Problems creating Qt 4.6.3 static with MinGw
Forgot this : Platforms used : XP 32 bit and Windows 7 64 bit
Re: Problems creating Qt 4.6.3 static with MinGw
I think only WebKit & Debugging (QtCreator) is not supported in Win2K. Compiling without these should work.
Re: Problems creating Qt 4.6.3 static with MinGw
I was not using Webkit. A very minimalist config:
-static
-release
-no-exceptions
-no-rtti
-nomake
examples
-nomake
demos
-qt-sql-sqlite
-qt-sql-odbc
-no-qt3support
-no-accessibility
-no-stl
-no-gif
-no-libpng
-no-libtiff
-no-libjpeg
-no-libmng
-no-openssl
-no-phonon
-no-multimedia
-no-script
-no-scripttools
-no-webkit
-no-qmake
-saveconfig
mycfg
-no-opengl
-no-style-cde
-no-style-motif
-no-style-plastique
-no-style-cleanlooks
Re: Problems creating Qt 4.6.3 static with MinGw
I also tried to compile the static library on WinXP with all the standard settings (including WebKit...) and the MinGW deliverd with the Qt 4.6.3 package. - The same problem ! Compiling the library works but compiling the application breaks with the known linker error.
No one else with this problems ?
Re: Problems creating Qt 4.6.3 static with MinGw
Quote:
Originally Posted by
cunsdorfer
No one else with this problems ?
Yes, I also ran into this. Unfortunately I didn't realize it soon enough, because at the time I upgraded to Qt 4.6.2 I was working on a console/QtCore application which compiled and ran fine. As soon as I needed QtGui functionality for another project, WHAM! Kick in the face! :p
So, I was forced to redownload and recompile Qt 4.6.2.
Re: Problems creating Qt 4.6.3 static with MinGw
Add another person with this problem to the list. I'm fairly new to QT so banged my head for a while on this.
Re: Problems creating Qt 4.6.3 static with MinGw
I had the same link problem. I compared 4.6.2 with 4.6.3 and found that in src/gui/kernel/qapplication.cpp and src/gui/kernel/qwhatsthis.cpp they introduced Q_DECL_IMPORT which was causing the problem. I removed couple of those and was able to move on. Later encountered other problems for which I had to turn off phonon and s60. Currently it is still compiling. If I succeeded, I will let you know. My config:
-release
-static
-webkit
-platform
win32-g++
-qt-style-windowsxp
-qt-style-windowsvista
-prefix
c:\qt-4.6.3
-no-phonon
-no-s60
Re: Problems creating Qt 4.6.3 static with MinGw
lsong. I did the same thing last week and indeed it does work. However, I dont know the consequences of removing those lines. I would hope QT releases a fix for this.
Re: Problems creating Qt 4.6.3 static with MinGw
I asked qt support about the issue and got this back:
This is a known issue that you are running into and you can see the reports on the following links:
http://bugreports.qt.nokia.com/browse/QTBUG-10791
and
http://bugreports.qt.nokia.com/browse/QTBUG-11249
This has been fixed already, but the patch was submitted in the 4.7 branch and it contains changes that do not apply to 4.6.
The declarative module in new in 4.7 and the script engine has gone through changes too. You might be able to get it working by just leaving out the changes to these files.
I got a patch file which basically replaced all the "Q_DECL_IMPORT extern" with "Q_CORE_EXPORT". I manually changed them since the patch was for 4.7. You may find this helpful if you got sed on your system.
sed -i 's/Q_DECL_IMPORT extern/Q_CORE_EXPORT/g' *.cpp
Re: Problems creating Qt 4.6.3 static with MinGw
I downloaded Qt 4.7.0 BETA and tried compiling the static libraries. In this version everything seams to be OK belonging to that problem. But the BETA is bothering me to use 4.7.0 for now.
cunsdorfer
Re: Problems creating Qt 4.6.3 static with MinGw
I am running Qt 4.7.0 I still have static compile error. I tried 'config -no-qt3support' but still errors exist.
- NK