I'm trying to build boost asio timer sample within Eclipse on Windows and I occurred following errors:
g++ "-LC:\\Boost\\lib" -o boost_sync_timer.exe "src\\boost_sync_timer.o" -lws2_32 -llibboost_system-vc140-mt-1_61 -llibboost_system-vc140-mt-s-1_61 -llibboost_system-vc140-sgd-1_61 -llibboost_system-vc140-s-1_61 -llibboost_system-vc140-mt-sgd-1_61 -llibboost_system-vc140-mt-gd-1_61 -lboost_system-vc140-mt-1_61 -lboost_system-vc140-mt-gd-1_61
src\boost_sync_timer.o: In function `_static_initialization_and_destruction_0':
C:/Boost/include/boost-1_61/boost/system/error_code.hpp:221: undefined reference to `boost::system::generic_category()'
C:/Boost/include/boost-1_61/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
C:/Boost/include/boost-1_61/boost/system/error_code.hpp:223: undefined reference to `boost::system::system_category()'
src\boost_sync_timer.o: In function `ZN5boost6system10error_codeC1Ev':
C:/Boost/include/boost-1_61/boost/system/error_code.hpp:322: undefined reference to `boost::system::system_category()'
src\boost_sync_timer.o: In function `ZN5boost4asio5error19get_system_categoryEv':
C:/Boost/include/boost-1_61/boost/asio/error.hpp:230: undefined reference to `boost::system::system_category()'
collect2.exe: error: ld returned 1 exit status
There are already lots of similar issues posted but most of them are on Linux OS.(like undefined reference to boost::system::system_category() when compiling, -lboost_system should fix)
Although this post How to build boost::asio? is a similar issue, but its solution seems strange. My boost library is build with msvc-14.0(bjam --toolset=msvc-14.0 --build-type=complete architecture=x86 address-model=64 install). Should there be no difference no matter what compler to use while installing boost library?
As you can see, I import all "system" related libraries under "C:\Boost\lib", but there are still above errors! Any help? Thanks a lot!