Category: C++

Linking Boost library from Qt application with MinGW

While integrating NetCom’s app_gui module (Qt app) with GLog module that relies on Boost library, I encountered a long long list of linking errors: g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o .\NetCom.exe .\main.o .\MainWindow.o.\TestCaseDialog.o .\RunTestPlanDialog.o .\MsgCommDialog.o .\moc_MainWindow.o .\moc_TestCaseDialog.o .\moc_RunTestPlanDialog.o .\moc_MsgCommDialog.o -L"C:\Qt\2010.02.1\qt\lib" -L"C:\boost_1_41_0\stage\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4 -llibboost_date_time-mt-d C:\boost_1_41_0\stage\lib/libboost_date_time-mt-d.lib(greg_month.o): In function `ZN5boost9gregorian10greg_month17get_month_map_ptrEv': c:/boost_1_41_0/libs/date_time/src/gregorian/greg_month.cpp:36: undefined reference […]

Tuesday June 8th, 2010 in C++, Learning in progress, NetCom, Project | Comments Off

Build failure with Qt makefile: undefined reference to `_Unwind_Resume’

While building NetCom’s app_gui module through command line with the makefile auto-generated by Qt, I encountered following error: undefined reference to `_Unwind_Resume’ Just in case anyone makes the same mistake, here is the tip: makefile generated by Qt requires some environment variables to be set up beforehand.  In another word, if you run build from […]

Sunday April 4th, 2010 in C++, Learning in progress, NetCom, Project, Sharing | Comments Off

C++ library linking

While porting NetCom Simulator’s GLog module from Windows to Linux, I found all my library linking, i.e. to Boost C++ libraries, are broken. After some study and experiment works, I realize that library linking works slightly different on the two platforms. Here is my finding base on the experiment as well as ideas received from […]

Tuesday December 29th, 2009 in C++, Learning in progress, Sharing | Comments Off

GLog module is thread safe now

Finally, the GLog module can be use safely from multiple threads concurrently. This is achieved by using the Boost.Asio library, which is one of the options mentioned in previous post. Asio provides some convenient utilities, such as io_service and strand, which makes implementation of asynchronous I/O and synchronous access to shared resources relatively easy. In fact, these are the missing […]

Sunday December 20th, 2009 in C++, Learning in progress, NetCom, Project | Comments Off