[英]Boost undefined references cross compiling linux to windows
I'm trying to cross compile from linux to windows using boost. 我正在尝试使用boost从linux交叉编译到Windows。 I've already cross-compiled boost and I do have the DLL, but when I'm linking, I'm getting several undefined references : 我已经交叉编译了boost,并且确实有DLL,但是当我链接时,我得到了几个未定义的引用:
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x170): undefined reference to `boost::asio::io_service::io_service()' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x170):对`boost :: asio :: io_service :: io_service()的未定义引用
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x1b7): undefined reference to boost::asio::ip::address_v4::from_string(std::__cxx11::basic_string, std::allocator > const&)' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x1b7):对boost :: asio :: ip :: address_v4 :: from_string(std :: __ cxx11 :: basic_string,std :: allocator> const& )'
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x1c7): undefined reference to boost::asio::ip::address::address(boost::asio::ip::address_v4 const&)' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x1c7):对boost :: asio :: ip :: address :: address(boost :: asio :: ip :: address_v4 const&)的未定义引用
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x54e): undefined reference to `boost::asio::io_service::~io_service()' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x54e):对`boost :: asio :: io_service ::〜io_service()的未定义引用
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x5c0): undefined reference to `boost::asio::io_service::~io_service()' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x5c0):对`boost :: asio :: io_service ::〜io_service()的未定义引用
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text+0x97e): undefined reference to `boost::asio::io_service::run()' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x97e):对`boost :: asio :: io_service :: run()的未定义引用
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text$_ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERKNS1_7addressEt[_ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERKNS1_7addressEt]+0x2a): undefined reference to boost::asio::ip::detail::endpoint::endpoint(boost::asio::ip::address const&, unsigned short)' src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text $ _ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERKNS1_7addressEt [_ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERasas:as :: de :: de :: de :: de :: de :: de :: de :: de :: de :: de :: de :: de :: de :: deend:de: ip :: address const&,unsigned short)'
src/client/CommunicationHandler.o:CommunicationHandler.cpp:(.text$_ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE[_ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE]+0x20): undefined reference to boost::asio::detail::resolver_service_base::destroy(std::shared_ptr&)' SRC /客户端/ CommunicationHandler.o:CommunicationHandler.cpp :(文本$ _ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE [_ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE] + 0×20):未定义的引用,以提高:: ASIO ::详细:: resolver_service_base ::破坏(STD :: shared_ptr的&)”
...etc ...等等
Why does the symbols are not in the DLL? 为什么符号不在DLL中? What shall I do to make it link properly? 我该怎么做才能使其正确链接?
this make it works 这使它起作用
#ifndef BOOST_SYSTEM_USE_LIB # define BOOST_SYSTEM_USE_LIB #endif #ifndef BOOST_SYSTEM_USE_LIB#定义BOOST_SYSTEM_USE_LIB #endif
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.