boost :: asio :: io_context方法已停止:无法解析的外部符号

时间:2019-02-04 08:54:42

标签: c++ boost asio

我正在使用Boost 1.68.0和Visual Studio 2017

我有验证码

boost::shared_ptr<boost::asio::io_context> ioContext = nullptr;
ioContext = boost::make_shared<boost::asio::io_context>();
...
if (ioContext->stopped())
{...}

我收到链接错误

1>DownloadDirect.obj : error LNK2019: unresolved external symbol "public: bool __thiscall boost::asio::io_context::stopped(void)const " (?stopped@io_context@asio@boost@@QBE_NXZ) referenced in function "protected: void __thiscall DownloadDirect::downloadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?downloadFile@DownloadDirect@@IAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

如果我删除ioContext-> Stopped(),则错误消失,而代码使用了ioContext中的许多其他方法,并且它们没有此类问题

以这种方式构建的增强

.\b2 toolset=msvc address-model=32 -j8 threading=multi link=static runtime-link=static variant=debug runtime-debugging=on --build-type=complete

在项目设置中指定了所有必需的路径并在预处理器BOOST_ASIO_SEPARATE_COMPILATION的设置中指示了这些路径之后

我还能尝试做什么?

0 个答案:

没有答案
相关问题