2016-11-11 103 views
0

我想跨linux编译到Windows使用boost。我已经交叉编译提升,我有DLL,但是当我链接时,我得到几个未定义的引用:Boost未定义的参考交叉编译linux到windows

src/client/CommunicationHandler.o:CommunicationHandler.cpp :(。文本+ 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 + 0x1c7 ): 未定义参考to boost :: asio :: ip :: address :: address(boost :: asio :: ip :: address_v4 const &)'

src/client/CommunicationHandler.o:CommunicationHandler.cpp :(.text + 0x54e ):未定义引用`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):未定义的引用boost :: asio :: io_service :: run() '

src/client/CommunicationHandler.o:CommunicationHandler.cpp :(。text $ _ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERKNS1_7addressEt [_ZN5boost4asio2ip14basic_endpointINS1_3tcpEEC1ERKNS1_7addressEt] + 0x2a):未定义的引用boost :: asio :: ip :: detail :: endpoint :: endpoint(boost :: asio: :IP地址::常量&,无符号短)”

SRC /客户端/ CommunicationHandler.o:CommunicationHandler.cpp :(文本$ _ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE [_ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE] + 0×20):未定义的引用,以提高:: ASIO ::详细:: resolver_service_base :: destroy(std :: shared_ptr &)'

...等

为什么符号不在DLL中?我该怎么做才能正确链接?

回答

0

这使得它的工作原理

的#ifndef BOOST_SYSTEM_USE_LIB #定义BOOST_SYSTEM_USE_LIB #ENDIF