Results 1 to 4 of 4

Thread: Qt + boost + MinGW on Windows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Qt + boost + MinGW on Windows

    I'm trying to create a build environment which would include Qt 4.3 and boost 1.35.0 on both Linux and Windows, using Eclipse CDT as a common IDE on both platforms. On Linux things are quite straighforward, one just installs Eclipse CDT, the Qt-Eclipse integration plugin, and then everything compiles and links fine with the system supplied gcc and system installed boost libraries.

    But on Windows, I'm getting into issues. There I also downloaded Eclipse CDT, the Qt-Eclipse integration pluign, Qt itself, which in turn downloads a specific version of MinGW it likes. I can import and compile the source code samples that come with Qt with this setup.

    But I'm having trouble integration boost into the mix. I tried several approaches.

    Trying to link boost that was compiled for Visual C++

    First I downloaded the binary boost package compiled for Windows from Boost Consulting. It installs fine, and if I add the appropriate directory the include files are found. But, I can't link to any of the boost libraries provided, even if I supply the library path and the name of the library appropriately in the project file as:

    LIBS+= -Lc:\usr\boost\boost_1_35_0\lib -lboost_date_time-vc90-mt-1_35

    seemingly the symbols that are supposed to be in the library are not found by the MinGW linker:

    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import
    2. -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
    3. -Wl,-subsystem,windows -o release\hello_boost_opengl.exe
    4. release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
    5. release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
    6. -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
    7. -lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
    8. -lQtGui4 -lQtCore4
    9. release/BoostTime.o(.text$_ZN5boost9gregorian21to_simple_string_typeIcEESbIT_St11char_traitsIS2_ESaIS2_EERKNS0_4dateE[std::basic_string<char,
    10. std::char_traits<char>, std::allocator<char> >
    11. boost::gregorian::to_simple_string_type<char>(boost::gregorian::date
    12. const&)]+0x1b3):BoostTime.cpp: undefined reference to
    13. `boost::gregorian::greg_month::as_short_string() const'
    14. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    Trying to use MinGW from nuwen.net

    As an alternative approach, I tried using the MinGW distribution from nuwen.net, which conveniently contains boost as it is. But it seems that one can't really link Qt against this MinGW distribution, as I get:

    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import
    2. -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
    3. -Wl,-subsystem,windows -o release\hello_boost_opengl.exe
    4. release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
    5. release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
    6. -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
    7. -lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
    8. -lQtGui4 -lQtCore4
    9. release/BoostTime.o:BoostTime.cpp:(.text$_ZN5boost9date_time14date_formatterINS_9gregorian4dateENS0_13simple_formatIcEEcE14date_to_stringES3_[boost::date_time::date_formatter<boost::gregorian::date,
    10. boost::date_time::simple_format<char>,
    11. char>::date_to_string(boost::gregorian::date)]+0x1f0): undefined reference
    12. to `boost::gregorian::greg_month::as_short_string() const'
    13. c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x26):
    14. undefined reference to `___gxx_personality_sj0'
    15. c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x39):
    16. undefined reference to `__Unwind_SjLj_Register'
    17. c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x255):
    18. undefined reference to `__Unwind_SjLj_Unregister'
    19. c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x32c):
    20. undefined reference to `__Unwind_SjLj_Resume'
    21. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 


    maybe the next approach would be to use the MinGW version that is downloaded by Qt, get MSYS, and compile it manually. I wonder if there's a binary downloadable version of boost that can be used out of the box with Qt and MinGW

    All help is appreciated
    Last edited by akos.maroy; 12th June 2008 at 11:53.

Similar Threads

  1. using libcurl in QT with Mingw in Windows
    By ct in forum Qt Programming
    Replies: 18
    Last Post: 23rd January 2012, 01:41
  2. A Guide to Install MinGW, Qt4 and Eclipse Integration on Windows XP
    By shiyutang in forum Installation and Deployment
    Replies: 10
    Last Post: 5th August 2009, 04:03
  3. Mingw very slow on windows
    By elsheikhmh in forum Installation and Deployment
    Replies: 7
    Last Post: 30th May 2007, 17:19
  4. How do I use MinGW Compiler in Windows
    By Walsi in forum General Discussion
    Replies: 3
    Last Post: 11th May 2007, 08:50
  5. qt and mingw can not run on windows 98?
    By evewei in forum Installation and Deployment
    Replies: 4
    Last Post: 26th June 2006, 09:22

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.