Problems linking shared library with ASIO/System/Serialization/Python
Hi All, I'm trying to build a shared library on Linux, that will become a Python module via Boost.Python. That library also requires functionality from Boost.ASIO and Boost.Serialization. I'm using Boost 1.46.1, and gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4). I'm getting undefined errors related to Boost.System during the compilation: g++ -L/usr/local/lib/ -shared python_client.o network_interface.o geometry_model_api.o client.o -o python_client.so -lpython2.7 -lboost_python -lboost_serialization -lboost_thread -lQtCore -lpthread -Wl,-no-undefined network_interface.o: In function `get_system_category': /usr/local/include/boost/asio/error.hpp:220: undefined reference to `boost::system::system_category()' /usr/local/include/boost/asio/error.hpp:220: undefined reference to `boost::system::system_category()' /usr/local/include/boost/asio/error.hpp:220: undefined reference to `boost::system::system_category()' /usr/local/include/boost/asio/error.hpp:220: undefined reference to `boost::system::system_category()' network_interface.o: In function `error_code': /usr/local/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()' network_interface.o:/usr/local/include/boost/asio/error.hpp:220: more undefined references to `boost::system::system_category()' follow client.o: In function `__static_initialization_and_destruction_0': /usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()' /usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()' /usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()' client.o: In function `get_system_category': /usr/local/include/boost/asio/error.hpp:220: undefined reference to `boost::system::system_category()' client.o: In function `error_code': /usr/local/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()' /usr/local/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()' /usr/local/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()' client.o:/usr/local/include/boost/system/error_code.hpp:315: more undefined references to `boost::system::system_category()' follow collect2: ld returned 1 exit status I tried defining BOOST_SYSTEM_NO_DEPRECATED, some errors disappear, others don't. Any advice is greatly appreciated. Thanks in advance. -- federico
I'm trying to build a shared library on Linux, that will become a Python module via Boost.Python. That library also requires functionality from Boost.ASIO and Boost.Serialization. I'm using Boost 1.46.1, and gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4). I'm getting undefined errors related to Boost.System during the compilation:
g++ -L/usr/local/lib/ -shared python_client.o network_interface.o geometry_model_api.o client.o -o python_client.so -lpython2.7 -lboost_python -lboost_serialization -lboost_thread -lQtCore -lpthread -Wl,-no-undefined network_interface.o: In function `get_system_category':
You should link with Boost.System: -lboost_system
participants (2)
-
Federico J. Fernández
-
Igor R