Problem with boost.asio
I use boost.asio timer in my program. and the timer require the boost.system because of the boost::system::error_code in hanlder functions. I use this command to get output from this: g++ timer3.cpp -lboost_thread but this cause this error: /tmp/ccNQAhKx.o: In function `__static_initialization_and_destruction_0(int, int)': timer3.cpp:(.text+0x21a): undefined reference to `boost::system::get_system_category()' timer3.cpp:(.text+0x224): undefined reference to `boost::system::get_posix_category()' timer3.cpp:(.text+0x22e): undefined reference to `boost::system::get_posix_category()' timer3.cpp:(.text+0x238): undefined reference to `boost::system::get_system_category()' /tmp/ccNQAhKx.o: In function `boost::asio::error::get_system_category()': timer3.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x7): undefined reference to `boost::system::get_system_category()' /tmp/ccNQAhKx.o: In function `boost::system::error_code::error_code()': timer3.cpp:(.text._ZN5boost6system10error_codeC1Ev[boost::system::error_code::error_code()]+0x10): undefined reference to `boost::system::get_system_category()' collect2: ld returned 1 exit status then I also link the boost_system: g++ timer3.cpp -lboost_thread -lboost_system but g++ can not find the libboost_system althoght we have these file in the /usr/lib folder: /usr/lib/libboost_system-gcc42-mt-1_35.so /usr/lib/libboost_system-gcc42-mt-1_35.so.1.35.0 and these files in the /usr/local/lib : /usr/local/lib/libboost_system-gcc42-mt-1_35.so /usr/local/lib/libboost_system-gcc42-mt-1_35.so.1.35.0 /usr/local/lib/libboost_system-gcc42-mt.so can anyone help me that whats wrong with me? and is the boost_system installed properly? -- View this message in context: http://www.nabble.com/Problem-with-boost.asio-tp19232020p19232020.html Sent from the Boost - Users mailing list archive at Nabble.com.
On Sat, Aug 30, 2008 at 9:34 AM, Moji
then I also link the boost_system:
g++ timer3.cpp -lboost_thread -lboost_system
but g++ can not find the libboost_system althoght we have these file in the /usr/lib folder:
/usr/lib/libboost_system-gcc42-mt-1_35.so /usr/lib/libboost_system-gcc42-mt-1_35.so.1.35.0
and these files in the /usr/local/lib :
/usr/local/lib/libboost_system-gcc42-mt-1_35.so /usr/local/lib/libboost_system-gcc42-mt-1_35.so.1.35.0 /usr/local/lib/libboost_system-gcc42-mt.so
What you give "-lboost_system", the linker would search for libboost_system.so file. Is there such a file? It most probably would be a soft link to one of the shared library that you mentioned above. Also try providing the path to the shared library will the -L option. $ ls /usr/local/lib/libboost_system.so /usr/lib/libboost_system.so # one of them should be there $ g++ timer3.cpp -L/usr/local/lib -L/usr/lib -lboost_thread -lboost_system Hope that helps. Rgds, anna -- Abusive Language on Internet http://missingrainbow.blogspot.com/2008/08/abusive-language-on-internet.html
participants (2)
-
Annamalai Gurusami
-
Moji