1
http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/example/allocation/server.cppErreur lors de la compilation du code simple dans boost. Comment trouver le nom de la bibliothèque?
g++ -L./lib/boost_1_41_0/ -L./lib/soci-3.0.0/ -L/usr/lib/ -L/usr/local/lib/ -L./ -I/usr/include -I./lib/boost_1_41_0 -o main server.o -lssl -pthread
server.o: In function `error_code':
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
server.o: In function `get_system_category':
/test/mycode/./lib/boost_1_41_0/boost/asio/error.hpp:218: undefined reference to `boost::system::get_system_category()'
server.o: In function `error_code':
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
server.o: In function `__static_initialization_and_destruction_0':
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:208: undefined reference to `boost::system::get_system_category()'
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:209: undefined reference to `boost::system::get_generic_category()'
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::get_generic_category()'
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:215: undefined reference to `boost::system::get_generic_category()'
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:216: undefined reference to `boost::system::get_system_category()'
server.o: In function `error_code':
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
server.o: In function `get_system_category':
/test/mycode/./lib/boost_1_41_0/boost/asio/error.hpp:218: undefined reference to `boost::system::get_system_category()'
server.o: In function `error_code':
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
/test/mycode/./lib/boost_1_41_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
server.o:/test/mycode/./lib/boost_1_41_0/boost/asio/error.hpp:218: more undefined references to `boost::system::get_system_category()' follow
collect2: ld returned 1 exit status
make: *** [main] Error 1
Comment supprimer l'erreur ci-dessus
g ++ -L./lib/boost_1_41_0/ -L./lib/soci-3.0.0/ -L/usr/lib/-L/usr/local/lib/-L./ -I/usr/include -I./lib/boost_1_41_0 -o serveur principal.o -lssl -lboost_system -mt -pthread /usr/bin/ld.real: impossible de trouver -lboost_system-mt collect2: ld a renvoyé 1 statut de sortie –
Alors que font les bibliothèques? Vous avez lib/boost_1_41_0 – Mark
J'ai boost_system (à la fois en .a et en .so) et boost_system-mt. –