akos.maroy
12th June 2008, 12:39
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 (http://www.boost-consulting.com/products/free). 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:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
-Wl,-subsystem,windows -o release\hello_boost_opengl.exe
release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
-lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
-lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
-lQtGui4 -lQtCore4
release/BoostTime.o(.text$_ZN5boost9gregorian21to_simple_s tring_typeIcEESbIT_St11char_traitsIS2_ESaIS2_EERKN S0_4dateE[std::basic_string<char,
std::char_traits<char>, std::allocator<char> >
boost::gregorian::to_simple_string_type<char>(boost::gregorian::date
const&)]+0x1b3):BoostTime.cpp: undefined reference to
`boost::gregorian::greg_month::as_short_string() const'
collect2: ld returned 1 exit status
Trying to use MinGW from nuwen.net
As an alternative approach, I tried using the MinGW distribution from nuwen.net (http://nuwen.net/mingw.html), which conveniently contains boost as it is. But it seems that one can't really link Qt against this MinGW distribution, as I get:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
-Wl,-subsystem,windows -o release\hello_boost_opengl.exe
release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
-lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
-lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
-lQtGui4 -lQtCore4
release/BoostTime.o:BoostTime.cpp:(.text$_ZN5boost9date_ti me14date_formatterINS_9gregorian4dateENS0_13simple _formatIcEEcE14date_to_stringES3_[boost::date_time::date_formatter<boost::gregorian::date,
boost::date_time::simple_format<char>,
char>::date_to_string(boost::gregorian::date)]+0x1f0): undefined reference
to `boost::gregorian::greg_month::as_short_string() const'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 26):
undefined reference to `___gxx_personality_sj0'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 39):
undefined reference to `__Unwind_SjLj_Register'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 255):
undefined reference to `__Unwind_SjLj_Unregister'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 32c):
undefined reference to `__Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
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
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 (http://www.boost-consulting.com/products/free). 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:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
-Wl,-subsystem,windows -o release\hello_boost_opengl.exe
release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
-lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
-lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
-lQtGui4 -lQtCore4
release/BoostTime.o(.text$_ZN5boost9gregorian21to_simple_s tring_typeIcEESbIT_St11char_traitsIS2_ESaIS2_EERKN S0_4dateE[std::basic_string<char,
std::char_traits<char>, std::allocator<char> >
boost::gregorian::to_simple_string_type<char>(boost::gregorian::date
const&)]+0x1b3):BoostTime.cpp: undefined reference to
`boost::gregorian::greg_month::as_short_string() const'
collect2: ld returned 1 exit status
Trying to use MinGW from nuwen.net
As an alternative approach, I tried using the MinGW distribution from nuwen.net (http://nuwen.net/mingw.html), which conveniently contains boost as it is. But it seems that one can't really link Qt against this MinGW distribution, as I get:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
-Wl,-subsystem,windows -o release\hello_boost_opengl.exe
release/BoostTime.o release/GlWidget.o release/main.o release/MainWindow.o
release/moc_GlWidget.o release/moc_Mainwindow.o -L"c:\usr\Qt\4.3.5\lib"
-lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain
-lboost_date_time-vc80-mt-1_35 -Lc:\usr\boost\boost_1_35_0\lib -lQtOpenGL4
-lQtGui4 -lQtCore4
release/BoostTime.o:BoostTime.cpp:(.text$_ZN5boost9date_ti me14date_formatterINS_9gregorian4dateENS0_13simple _formatIcEEcE14date_to_stringES3_[boost::date_time::date_formatter<boost::gregorian::date,
boost::date_time::simple_format<char>,
char>::date_to_string(boost::gregorian::date)]+0x1f0): undefined reference
to `boost::gregorian::greg_month::as_short_string() const'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 26):
undefined reference to `___gxx_personality_sj0'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 39):
undefined reference to `__Unwind_SjLj_Register'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 255):
undefined reference to `__Unwind_SjLj_Unregister'
c:\usr\Qt\4.3.5\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 32c):
undefined reference to `__Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
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