将ASIO链接到Visual Studio中没有提升的项目

Linking ASIO to a project without boost in Visual Studio

本文关键字:项目 链接 ASIO Visual Studio      更新时间:2023-10-16

我正在尝试在Visual Studio中为项目使用asio而不进行boost。

我通过在项目属性中的Additional Include Directories中添加asioinclude来添加标头。 这允许我的项目看到标题,并且智能感知正确找到所有对象。 目前为止,一切都好。

但是,当我尝试编译时,我收到找不到提升标头的错误,例如:

cannot open source file "boost/date_time/posix_time/posix_time_types.hpp" example-udpreceiver c:Usersmeprojectlibsasio-1.10.6includeasiodeadline_timer.hpp

cannot open source file "boost/regex/v4/match_flags.hpp" example-udpreceiver c:Usersmeprojectlibsasio-1.10.6includeasiodetailregex_fwd.hpp

我的印象是可以在没有 boost 的情况下使用 asio - 我需要做什么才能让 asio 编译我的项目?

谢谢!

您需要

定义ASIO_STANDALONE宏以使 asio 在独立模式下正常工作。