undefined reference to `boost::system::system_category(), but I already have -lboost_system

385 views Asked by At

Getting this error from a cpp library I'm trying to port from Linux to Windows, using code::blocks. I'm new to c++ in general but especially new to Windows and CB.

I'm pretty sure I have added the system library accordingly, by which I mean I have compiled it using:

.\b2 -j 8 variant=release link=shared threading=single

Then gone to the lib directory, found boost_system-vc120-1_55.dll and renamed it boost_system.dll

The added F:\plus\boost\boost_1_55_0\stage\lib to the Build options, search directories, linker. (And F:\plus\boost\boost_1_55_0\ in search directories, compiler)

The -lboost_system is after the cpp files in the compile command, although for some reason it's listed twice, but I tried compiling in command prompt without the first one and gave same error.

This is the build output I get:

-------------- Build: Release in sendd (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LF:\plus\wxWidgets-3.0.2\lib\gcc_dll -LF:\plus\boost\boost_1_55_0\stage\lib -o bin\Release\sendd.exe obj\Release\gsmencoding.o obj\Release\hexdump.o obj\Release\pdu.o obj\Release\senddApp.o obj\Release\senddMain.o obj\Release\smpp.o obj\Release\smppclient.o obj\Release\sms.o obj\Release\timeformat.o  obj\Release\resource.res -s -mthreads -lwsock32 -lws2_32 -lboost_system  -lwxmsw30u -lboost_system -mwindows
obj\Release\smppclient.o:smppclient.cpp:(.text+0x724): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text+0x769): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text+0xb28): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text+0xf28): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text+0xfaf): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text+0x13a5): more undefined references to `boost::system::system_category()' follow
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x1b): undefined reference to `boost::system::generic_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x25): undefined reference to `boost::system::generic_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x2f): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x39): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x43): undefined reference to `boost::system::system_category()'
obj\Release\smppclient.o:smppclient.cpp:(.text.startup+0x4d): undefined reference to `boost::system::system_category()'

Any ideas? Thanks!

0

There are 0 answers