Results 1 to 13 of 13

Thread: Problems creating Qt 4.6.3 static with MinGw

  1. #1
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Unhappy 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 ?

  2. #2

    Default 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.

  3. #3

    Unhappy Re: Problems creating Qt 4.6.3 static with MinGw

    Forgot this : Platforms used : XP 32 bit and Windows 7 64 bit

  4. #4
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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.

  5. #5

    Default 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

  6. #6
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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 ?

  7. #7
    Join Date
    Nov 2009
    Location
    Greece
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems creating Qt 4.6.3 static with MinGw

    Quote Originally Posted by cunsdorfer View Post
    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!

    So, I was forced to redownload and recompile Qt 4.6.2.

  8. #8
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  9. #9
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default 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

  10. #10
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  11. #11
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default 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

  12. #12
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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

  13. #13
    Join Date
    Sep 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

Similar Threads

  1. Creating Static library with QT
    By QPlace in forum Qt Programming
    Replies: 2
    Last Post: 21st December 2008, 05:50
  2. Replies: 22
    Last Post: 8th October 2008, 14:54
  3. Problem compiling Qt4.4.0 with mingw-static in examples/webkit
    By KjellKod in forum Installation and Deployment
    Replies: 2
    Last Post: 10th July 2008, 14:32
  4. Creating Static libraries in Qt/Mac
    By nareshqt in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2008, 12:45
  5. how to build static application with MinGw?
    By mismael85 in forum Installation and Deployment
    Replies: 9
    Last Post: 11th March 2008, 21:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.