Results 1 to 9 of 9

Thread: compile / link error mingw-make release

  1. #1
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default compile / link error mingw-make release

    Hi together,

    I get the following linker error when i compile my qt-app in release mode:

    Qt Code:
    1. c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x1c2): undefined reference to `__Unwind_Resume'
    2. c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text$_ZN7QVectorIPcE7reallocEii[QVector<char*>::realloc(int, int)]+0x187): undefined reference to `__Unwind_Resume'
    3. c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.eh_frame+0x12): undefined reference to `___gxx_personality_v0'collect2: ld returned 1 exit status
    4. mingw32-make: *** [release\TokenInitializer.exe] Error 1
    To copy to clipboard, switch view to plain text mode 

    when I compile and link my qt-app in debug mode, everything is fine.
    Also when I rename the libqtmaind to libqtmain...
    Is here a known issue in the libqtmain?
    Or do I anything wrong?

    I have a windows 7 (32 bit) system and use qt 4.6.2 and MinGW 5.1.6.

    Thanks for help.
    JM

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compile / link error mingw-make release

    Also when I rename the libqtmaind to libqtmain...
    Is here a known issue in the libqtmain?
    In debug mode you are linking agianst the Qt debug build (that is why it has the d at the end of the name).
    When you build a release version, you have to link against a release Qt build.
    Usually you should have both versions under $(QTDIR)/bin.
    But if you built it your self, it might be that you only have the debug version.
    So make sure you have Qt release.
    Another option is that you make file (specially if you made it your self) is not linking against release libs for release mode.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: compile / link error mingw-make release

    Thank you.

    But now I'm a little bit confused.
    I have a $(QTDIR)/bin and a $(QTDIR)/lib directory.
    In both I have QtCore4.dll and QtCore4d.dll and so on...
    But in the lib directory I have also
    libqtmain.a, libqtmaind.a, qtmain.prl and qtmaind.prl
    but I have no match in the bin directory for these qtmain files...

    Is it normal? Or is anything missing in my bin directory? :/

    ----
    But when I rename the libqtmaind.a to libqtmain.a in the lib - dir, everything is fine...
    Is it possible that the libqtmain file is wrong?

    I build my Makefiles with qmake.
    This is my pro File:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = TokenInitializer
    3. CONFIG += debug_and_release
    4. CONFIG += thread
    5. QT += core \
    6. gui \
    7. sql
    8. HEADERS += PasswortGeneratorInterface.h \
    9. PasswortGeneratorFactoryInterface.h \
    10. PasswortGeneratorInterface.h \
    11. TokenInitThread.h \
    12. PKI_Certificate.h \
    13. TokenInfoInterface.h \
    14. Settings.h \
    15. PKCS11TokenInterface.h \
    16. PKCS11TokenFactoryInterface.h \
    17. EncrypterInterface.h \
    18. tokeninitializer.h
    19. SOURCES += TokenInitThread.cpp \
    20. PKI_Certificate.cpp \
    21. Settings.cpp \
    22. main.cpp \
    23. tokeninitializer.cpp
    24. FORMS += tokeninitializer.ui
    25. unix:INCLUDEPATH += /usr/include/eToken/ \
    26. /usr/include/PCSC/ \
    27. /usr/include/
    28. win32:INCLUDEPATH += C:/EToken/include/ \
    29. C:/MinGW/include/
    30.  
    31. # install
    32. unix:target.path = /home/pki/tools/TokenInitializer
    33. wind32:target.path = C:/workspace/TokenInitializer
    34. sources.files = $$SOURCES \
    35. $$HEADERS \
    36. $$RESOURCES \
    37. $$FORMS \
    38. TokenInitializer.pro
    39. unix:sources.path = /home/pki/tools/TokenInitializer
    40. win32:sources.path = C:/workspace/TokenInitializer
    41. INSTALLS += target \
    42. sources
    43. symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
    To copy to clipboard, switch view to plain text mode 

    Thanks for help
    JM

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compile / link error mingw-make release

    but I have no match in the bin directory for these qtmain files...
    the *.a libs are static libs, which are MinGW/unix style libs, so when you link against them you have all the information you need, so there is no need for symbol files to link against.
    Its looks like you are linking statically against Qt, and it looks like you don't have the release version of the static libs. do you really want that?

    You wrote:
    But in the lib directory I have also
    libqtmain.a, libqtmaind.a
    And
    But when I rename the libqtmaind.a to libqtmain.a
    So do you or don't you have libqtmain.a?

    If you don't, then you don't have the release static version.
    But you should really consider linking dynamically,of course, it depends on the requirements of you project.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: compile / link error mingw-make release

    So do you or don't you have libqtmain.a?
    I have a libqtmain.a, but when I use the original one, I get the errors described above.
    When I rename the debug version and try again... everything is fine.

    I don't want to build static. I want to build my app dynamic and I tought that I do it.
    I don't know why the libqtmain.a file is choosen from minGW. I have downloaded the qt-win-opensource-4.6.2-mingw.exe and installed it. I also use the function: Build Debug Libraries... and it works.

    I don't use the CONFIG += static option in the pro file.
    So why is mingw trying to link to the libqtmain..a?
    I don't know what I can do now.

    Thank you very much for your help.
    JM
    Last edited by jm; 30th June 2010 at 13:15.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compile / link error mingw-make release

    I have a libqtmain.a, but when I use the original one, I get the errors described above.
    Hmm... that is not good,something is fishy.

    check you project settings, maybe you have somewhere ticked a static link option?
    Can you show TokenInitializer.pro?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: compile / link error mingw-make release

    Yes, it is very confusing.

    My TokenInitializer.pro file is the following:

    Qt Code:
    1. TEMPLATE = app
    2. TARGET = TokenInitializer
    3. CONFIG += debug_and_release
    4. CONFIG += thread
    5. QT += core \
    6. gui \
    7. sql
    8. HEADERS += PasswortGeneratorInterface.h \
    9. PasswortGeneratorFactoryInterface.h \
    10. PasswortGeneratorInterface.h \
    11. TokenInitThread.h \
    12. PKI_Certificate.h \
    13. TokenInfoInterface.h \
    14. Settings.h \
    15. PKCS11TokenInterface.h \
    16. PKCS11TokenFactoryInterface.h \
    17. EncrypterInterface.h \
    18. tokeninitializer.h
    19.  
    20. SOURCES += TokenInitThread.cpp \
    21. PKI_Certificate.cpp \
    22. Settings.cpp \
    23. main.cpp \
    24. tokeninitializer.cpp
    25.  
    26. FORMS += tokeninitializer.ui
    27.  
    28. unix:INCLUDEPATH += /usr/include/eToken/ \
    29. /usr/include/PCSC/ \
    30. /usr/include/
    31.  
    32. win32:INCLUDEPATH += C:/EToken/include/ \
    33. C:/MinGW/include/
    34.  
    35. # install
    36. unix:target.path = /home/pki/tools/TokenInitializer
    37. wind32:target.path = C:/workspace/TokenInitializer
    38. sources.files = $$SOURCES \
    39. $$HEADERS \
    40. $$RESOURCES \
    41. $$FORMS \
    42. TokenInitializer.pro
    43. unix:sources.path = /home/pki/tools/TokenInitializer
    44. win32:sources.path = C:/workspace/TokenInitializer
    45. INSTALLS += target \
    46. sources
    47. symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
    To copy to clipboard, switch view to plain text mode 

    I searched in the file, but no "static" string could be found, also in the Makefile.Release (attachment).

    I really don't know where could be the error.

    I tried a little stupid "Hello World" Qt app and I get the same error. I think something is broken in my QT...
    But when I compile a Qt - Program as "Template = lib Config += plugin" the release mode is normally working...

    I think it is a problem when the libqtmain.a is needed.

    I'm about to despair.

    Thanks a lot.
    JM
    Attached Files Attached Files

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compile / link error mingw-make release

    I meant the makefile (not the pro), sorry, so its good you posted it.
    Based on what you posted , I don't see what is causing the problem.
    You might have some sort of configuration problem in MinGW or the IDE you use.
    Or, I just that I missed something in the info you posted.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: compile / link error mingw-make release

    I think it is a problem wiht my MinGW configuration, but I really don't know what.
    I downloaded and installed the qt-win-opensource-4.6.2-mingw.exe...
    I write my QT - App on Kubunutu with eclipse, but I need the application also for windows that's the reason why I compile and link it on windows. I have no IDE on the windows machine. I only use MinGW and QT Command Prompt.


    So many thanks for your help. I hope I find a solution.
    If I get one, I will post it here.

    JM

Similar Threads

  1. Replies: 0
    Last Post: 21st February 2010, 18:09
  2. Is Qt 4.4.0 compatible with the current MinGW 5.1.4 release?
    By BernieW in forum Installation and Deployment
    Replies: 4
    Last Post: 31st July 2008, 23:16
  3. make error when compile qtopia 4.2.4
    By evewei in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd November 2007, 11:44
  4. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  5. QtNetwork error by compile MingW qt4.2
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 15:09

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
  •  
Qt is a trademark of The Qt Company.