Results 1 to 6 of 6

Thread: Error in static compilation of Qt 2010.05!

  1. #1
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Error in static compilation of Qt 2010.05!

    Hi!
    I configured my system (WinXP) to statically compile Qt.
    I have set up the mingw binaries in my path and everything needed for the compilation.
    I configured the qt sources with:
    configure -static -release -nomake demo -nomake examples -platform win32-g++
    The configure ended perfectly with no errors.
    I entered 'mingw32-make sub-src' and after a while these errors came up:

    Qt Code:
    1. release/main.o:main.cpp:(.text+0x3e2a): undefined reference to `qFree(void*)'
    2. release/main.o:main.cpp:(.text+0x3e81): undefined reference to `qFree(void*)'
    3. release/main.o:main.cpp:(.text+0x3ebf): undefined reference to `QHashData::free_
    4. helper(void (*)(QHashData::Node*))'
    5. release/main.o:main.cpp:(.text+0x3ef8): undefined reference to `qt_assert_x(char
    6. const*, char const*, char const*, int)'
    7. release/main.o:main.cpp:(.text+0x3f41): undefined reference to `QByteArray::oper
    8. ator=(QByteArray const&)'
    9. release/main.o:main.cpp:(.text$_ZN5QListI7QStringE4freeEPN9QListData4DataE[QList
    10. <QString>::free(QListData::Data*)]+0x34): undefined reference to `QString::free(
    11. QString::Data*)'
    12. release/main.o:main.cpp:(.text$_ZN5QListI7QStringE4freeEPN9QListData4DataE[QList
    13. <QString>::free(QListData::Data*)]+0x57): undefined reference to `qFree(void*)'
    14. release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE4freeEPN9
    15. QListData4DataE[QList<Preprocessor::IncludePath>::free(QListData::Data*)]+0x42):
    16. undefined reference to `qFree(void*)'
    17. release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE4freeEPN9
    18. QListData4DataE[QList<Preprocessor::IncludePath>::free(QListData::Data*)]+0x6f):
    19. undefined reference to `qFree(void*)'
    20. release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE6appendER
    21. KS1_[QList<Preprocessor::IncludePath>::append(Preprocessor::IncludePath const&)]
    22. +0x3e): undefined reference to `QListData::detach_grow(int*, int)'
    23. release/main.o:main.cpp:(.text$_ZN5QListIN12Preprocessor11IncludePathEE6appendER
    24. KS1_[QList<Preprocessor::IncludePath>::append(Preprocessor::IncludePath const&)]
    25. +0x15f): undefined reference to `QListData::append()'
    26. release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB
    27. yteArray>::~QMap()]+0x34): undefined reference to `QMapData::continueFreeData(in
    28. t)'
    29. release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB
    30. yteArray>::~QMap()]+0x5a): undefined reference to `qFree(void*)'
    31. release/main.o:main.cpp:(.text$_ZN4QMapI10QByteArrayS0_ED1Ev[QMap<QByteArray, QB
    32. yteArray>::~QMap()]+0x70): undefined reference to `qFree(void*)'
    33. release/main.o:main.cpp:(.text$_ZN5QListI8ClassDefED1Ev[QList<ClassDef>::~QList(
    34. )]+0x6d): undefined reference to `qFree(void*)'
    35. collect2: ld returned 1 exit status
    36. mingw32-make[2]: *** [..\..\..\bin\moc.exe] Error 1
    37. mingw32-make[2]: Leaving directory `C:/Qt/2010.05/qt/src/tools/moc'
    38. mingw32-make[1]: *** [release] Error 2
    39. mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/src/tools/moc'
    40. mingw32-make: *** [sub-moc-sub_src_target_ordered] Error 2
    41.  
    42. C:\Qt\2010.05\qt>
    To copy to clipboard, switch view to plain text mode 

    Please, can you tell me where the problem is?
    What should I do so that these errors don't come up anymore and to build Qt statically correctly?

    P.S.: This is my fifth attempt to compile Qt statically after four other attempts with four different versions of Qt in the past and each one of them ending in an error like this (mostly ending like this in the "moc" directory, if I remember correctly) in the "make" phase. It seems like building Qt statically is impossible!

  2. #2
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error in static compilation of Qt 2010.05!

    Hi,

    Dont't know what the problem is, but can tell you that building Qt statically with MingW is possible. I downloaded the pre-build installer with MingW. This installer installed everything, including MinGw, but this is a dynamic build of course. Then I re-build it as you described, without problems. With VS, I did have the problem that I had to delete the old .dll files from the plugin directory first, because they were used instead of the static libraries.

    Note there is still a dependency on a MingW DLL though. See Mingw static build.

    Best regards,
    Marc

  3. #3
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error in static compilation of Qt 2010.05!

    Quote Originally Posted by marcvanriet View Post
    Hi,

    Dont't know what the problem is, but can tell you that building Qt statically with MingW is possible. I downloaded the pre-build installer with MingW. This installer installed everything, including MinGw, but this is a dynamic build of course. Then I re-build it as you described, without problems. With VS, I did have the problem that I had to delete the old .dll files from the plugin directory first, because they were used instead of the static libraries.

    Note there is still a dependency on a MingW DLL though. See Mingw static build.

    Best regards,
    Marc
    Hi!
    Finally someone answered! Thank you!
    I don't know but it seems to me that only few have gotten Qt to build statically.
    Could you please describe in detail step-by-step your build procedure?
    Which Qt version did you use?
    Did you download the Qt Creator + SDK installer or only the Qt SDK?

  4. #4
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error in static compilation of Qt 2010.05!

    Hi,

    It's been some time ago that I did the build, and also I used MSVC, so I can't really give you a step-by-step. I tried with MingW once, only to find that there was still a dependency on some small DLL.

    I used hints from the folllowing webpages : Building static Qt on Windows, Building Qt static and making it small with GCC, MSVC and Intel compiler..

    As far as I remember, I downloaded the pre-build SDK (the one that just installs itself including MingW, and that doesn't require building yourself) and then re-build with MingW with the options to make it static.

    I have built 4.6.2 and 4.6.3.

    For QtCreator, I downloaded the version 2.0 installer, and it worked fine. Only I can't build the debug helper for MSVC, but I think that is because QtCreator is build dynamically, and my Qt version is static.

    Best regards,
    Marc

  5. #5
    Join Date
    Oct 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error in static compilation of Qt 2010.05!

    I followed those instructions but still I get the same error.
    I give up. I'm going to use Qt as is, shared, and distribute my apps with the required dll's.

  6. #6
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error in static compilation of Qt 2010.05!

    sorry wrong thread please delete my post

Similar Threads

  1. Qt 4.7.0 source compilation errors (MSVC 2010, Windows 7 Ultimate 64-bit)
    By andrey.khaletsky in forum Installation and Deployment
    Replies: 3
    Last Post: 30th September 2010, 08:16
  2. cannot compile QT 4.6 as static - uic3 error stops compilation
    By rucs_hack in forum Installation and Deployment
    Replies: 3
    Last Post: 27th June 2010, 05:35
  3. Plan for Visual Studio 2010 (MSVC 2010)?
    By Vinzz in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2010, 17:42
  4. Qt 4.5 compilation error on OS X 10.5.6
    By serega in forum Installation and Deployment
    Replies: 3
    Last Post: 20th March 2009, 15:25
  5. Qt 4 compilation error
    By mansoorulhaq in forum Installation and Deployment
    Replies: 1
    Last Post: 8th October 2007, 07:20

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.