我已经编译了 boost 并正在处理我的 Visual Studio 2022 项目。在 PC 升级并且操作系统更改为 Windows 11 后,我尝试重新构建 boost 并将其用于同一项目。现在我收到链接器错误,似乎我已经尝试了在线发布的所有建议修复。不知何故,似乎没有找到 lib 文件,即使我已经确认 include 和 lib 目录已正确包含,并尝试使用许多不同的配置重建 boost。
例如,boost 构建会生成 libboost_*.lib 文件
libboost_log_setup-vc143-mt-gd-x32-1_78.lib
libboost_log_setup-vc143-mt-x32-1_78.lib
libboost_log-vc143-mt-gd-x32-1_78.lib
libboost_log-vc143-mt-x32-1_78.lib
这是我的增强构建选项
x86
b2 -j 16 --stagedir=stage/Win32 线程=多 --toolset=msvc-14.3 链接=静态运行时链接=共享 --build-type=完整架构=x86 地址模型=32
x64
b2 -j 16 --stagedir=stage/x64 线程=多 --toolset=msvc-14.3 链接=静态运行时链接=共享 --build-type=完整架构=x64 --address-model=64
和我的 Visual Studio 属性
C/C++->常规->其他包含目录
C:\Program Files\Code Libraries\boost\boost_1_78_0
链接器->常规->其他库目录
C:\Program Files\Code Libraries\boost\boost_1_78_0\stage$(平台)\lib
这是错误的示例
1>Logging.obj : error LNK2019: unresolved external symbol "private: static unsigned int __cdecl boost::log::v2s_mt_nt62::attribute_name::get_id_from_string(char const *)" (?get_id_from_string@attribute_name@v2s_mt_nt62@log@boost@@CAIPBD@Z) referenced …Run Code Online (Sandbox Code Playgroud)