
Hi, I'm trying to compile the client example found in http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/tutorial/tutdaytime... tutorials), but I get the following errors: g++ -o dist/Debug/GNU-MacOSX/socketclient build/Debug/GNU-MacOSX/main.o Undefined symbols: "boost::system::get_system_category()", referenced from: boost::asio::error::get_system_category() in main.o boost::system::error_code::error_code()in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o ld: symbol(s) not found collect2: ld returned 1 exit status make[2]: *** [dist/Debug/GNU-MacOSX/socketclient] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 2s) Any idea why this is failing? Thanks Dann

Daniel V wrote:
Hi,
I'm trying to compile the client example found in http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/tutorial/tutdaytime... (boost::asio tutorials), but I get the following errors:
g++ -o dist/Debug/GNU-MacOSX/socketclient build/Debug/GNU-MacOSX/main.o Undefined symbols: "boost::system::get_system_category()", referenced from: boost::asio::error::get_system_category() in main.o boost::system::error_code::error_code()in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o "boost::system::get_generic_category()", referenced from: __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o __static_initialization_and_destruction_0(int, int)in main.o ld: symbol(s) not found collect2: ld returned 1 exit status make[2]: *** [dist/Debug/GNU-MacOSX/socketclient] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 2s)
Any idea why this is failing?
Thanks
Dann
It compiled. It isn't linking. The linker error is trying to tell you that it can't find a bunch of stuff from boost::system. Link the boost_system library too. michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com

В сообщении от 8 марта 2010 23:28:05 автор Daniel V написал:
Hi,
I'm trying to compile the client example found in http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/tutorial/tutdaytim e1/src.html(boost::asio tutorials), but I get the following errors:
g++ -o dist/Debug/GNU-MacOSX/socketclient build/Debug/GNU-MacOSX/main.o
use these flags: -lboost_system -lboost_iostreams -lboost_thread -lboost_regex

AMDG Konstantin V. Pleshakov wrote:
В сообщении от 8 марта 2010 23:28:05 автор Daniel V написал:
I'm trying to compile the client example found in http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/tutorial/tutdaytim e1/src.html(boost::asio tutorials), but I get the following errors:
g++ -o dist/Debug/GNU-MacOSX/socketclient build/Debug/GNU-MacOSX/main.o
use these flags: -lboost_system -lboost_iostreams -lboost_thread -lboost_regex
I don't think you need all of those. -lboost_system should be enough. In Christ, Steven Watanabe

use bjam save troubles.
2010/3/9 Rutger ter Borg
Steven Watanabe wrote:
I don't think you need all of those. -lboost_system should be enough.
-lboost_thread is also needed (unless you explicitly disable threads).
Cheers,
Rutger
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Igor R wrote:
-lboost_thread is also needed (unless you explicitly disable threads).
ASIO does not launch threads.
Yeah, you're right, I meant -pthread. At least on my platform (g++/linux), it does use stuff pthread_* from the posix thread libary (thread specific storage etc.). Cheers, Rutger
participants (7)
-
Daniel V
-
Igor R
-
Konstantin V. Pleshakov
-
l.jay Yuan
-
Michael Caisse
-
Rutger ter Borg
-
Steven Watanabe