提升未定义的引用交叉编译linux到windows

时间:2016-11-11 23:22:23

标签: c++ linux windows boost cross-compiling

我正在尝试使用boost从linux到windows的交叉编译。我已经交叉编译了boost,我确实有DLL,但是当我链接时,我得到了几个未定义的引用:

  

src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text + 0x170):未定义的引用`boost :: asio :: io_service :: io_service()'

     

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):对boost :: asio :: ip :: address :: address的未定义引用(boost :: asio :: ip :: address_v4 const& amp )'

     

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 :: address const&,unsigned short)'

     

src / client / CommunicationHandler.o:CommunicationHandler.cpp :(。text $ _ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE [_ZN5boost4asio2ip16resolver_serviceINS1_3tcpEE7destroyERSt10shared_ptrIvE] + 0x20):对boost :: asio :: detail :: resolver_service_base :: destroy(std :: shared_ptr&)的未定义引用“

...等

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

1 个答案:

答案 0 :(得分:0)

这使它有效

#ifndef BOOST_SYSTEM_USE_LIB #define BOOST_SYSTEM_USE_LIB #ENDIF