I am trying to create a 32 bit application on Ubuntu 11.04 x64. I'm having build problems due to linker errors with libboost. The build operator has -lboost_system
in it, but when I try to build, I get a bunch of them:
CommunicationModule.cpp :(. Text + 0x68c1): undefined link to boost::system::generic_category()
CommunicationModule.cpp :(. Text + 0x68d7): undefined link to boost::system::system_category()
Everything I found on google says that I need to connect to the boost_system library. One place I found says to try directly linking it, but when I do locate boost_system
, the result is empty. When I try to do sudo apt-get install libboost-system-dev
, it tells me that it is already installed. I am here somehow perplexed. The library is installed, but it was not found by searching?
Can someone tell me what I need to do for the correct link to boost :: system? I am new to Linux and compiler complexity, so any help here would be appreciated.
Update:
Here is the result of dpkg -L libboost-system1.42-dev
:
/. /usr /usr/share /usr/share/doc /usr/share/doc/libboost-system1.42-dev /usr/share/doc/libboost-system1.42-dev/copyright /usr/share/doc/libboost-system1.42-dev/NEWS.Debian.gz /usr/share/doc/libboost-system1.42-dev/README.Debian.gz /usr/lib /usr/lib/libboost_system.a /usr/lib/libboost_system-mt.so /usr/lib/libboost_system-mt.a /usr/lib/libboost_system.so
Is there a flag that I can use to refer to one of them directly? I tried using -L /usr/lib/libboost_system.so
and -L /usr/lib/libboost_system-mt.so
and none of them fixed the problem. Same thing with adding /usr/lib/libboost_system.a
and /usr/lib/libboost_system-mt.a
to the build statement.
Here is the compilation line:
g++ -m32 -Wl,-O1 -o UTNaoTool [.o files] -L/usr/lib32 -lqglviewer-qt4 -lqwt-qt4 -lboost_system -lboost_thread -lQtXml -lQtOpenGL -lQtGui -lQtNetwork -lQtCore -lGLU -lpthread
Update 2:
I downloaded boost 1.49 and built everything for 32-bit, and that seemed to help. A lot of errors have disappeared, but now I still have:
CommunicationModule.cpp :(. Text + 0x68c1): undefined promotion link :: System :: get_generic_category ()
Please note that the function is different. So, all my errors concern undefined references to get_system_category()
and get_generic_category()
. I tried to add the -lboost_filesystem
command to the build command, but this did not fix it, and I made sure that it refers to the 32-bit library that I built when I built libboost_system
.