【发布时间】:2021-10-26 12:00:08
【问题描述】:
我正忙于在 VS2019 中使用 Clang 编译我的项目,但我不能。 我将 VS2019 更新到最新版本,我现在正在使用 Clang 12.00。
在我的项目中,我使用的是 boost 库。为了构建 boost 库,我运行以下命令:
bootstrap --with-toolset=clang-win
b2.exe link=static threading=multi runtime-link=shared address-model=64 toolset=clang-win variant=release --build-type=complete --architecture=x64 cxxflags=-std=c++14
编译给了我这个错误:
1>lld-link : error : undefined symbol: __declspec(dllimport) public: __cdecl boost::thread::~thread(void)
我认为 boost 库不兼容。 VS 可以找到 boost 库,但我认为它无法读取其中的内容。
【问题讨论】:
-
您可能正在尝试静态链接 Boost.Thread。这是不受支持的,请参见例如boost.org/doc/libs/1_77_0/libs/config/doc/html/index.html
标签: visual-c++ clang c++14