简体   繁体   English

提升未定义的引用,将Linux交叉编译到Windows

[英]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.

相关问题 Linux 上 Windows 的交叉编译提升 - Cross-compiling boost for Windows on Linux 在Linux for Windows上交叉编译boost光纤库 - Cross compiling boost fiber library on Linux for Windows 当交叉编译(Linux 到 Windows)Vulkan 加载器时,有许多对 Vulkan 对象的未定义引用 - When Cross Compiling (Linux to Windows) The Vulkan Loader There Are Many Undefined References to Vulkan Objects 从 Linux-Windows 交叉编译,stdio 有未定义的引用(到 __imp___acrt_iob_func) - Cross Compiling from Linux-Windows, stdio has undefined references (to __imp___acrt_iob_func) 从Linux到Windows交叉编译boost 1.57的问题 - Problems cross-compiling boost 1.57 from Linux to Windows G ++ ARM交叉编译:未定义的引用 - G++ ARM cross compiling: undefined references 在Windows上交叉编译Linux(链接器输出文件不会在linux上作为可执行文件运行并且具有未定义的符号) - Cross compiling for Linux on Windows (linker output file won't run as executable on linux and has undefined symbols) 在Linux上与Eclipse交叉编译,在Windows上与Eclipse交叉编译? - cross compiling with Eclipse on linux and eclipse on windows? 在Linux for Windows上交叉编译Qt5 - Cross Compiling Qt5 on Linux for Windows Boost - 交叉编译 - “从Linux”到“Windows” - Boost - cross compile - “from Linux” “to Windows”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM