c++ 错误LNK2019:使用vcpkg中的llvm时,无法解析外部符号__std_max_element_1

w9apscun  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(152)

我刚刚使用vcpkg安装了llvm 17.0.2#1,构建进行得很好,但现在当我尝试使用它时,我得到了这个链接器错误:LLVMCore.lib(DataLayout.cpp.obj) : error LNK2019: unresolved external symbol __std_max_element_1 referenced in function "unsigned char const * __cdecl __std_max_element<unsigned char const >(unsigned char const *,unsigned char const *)" (??$__std_max_element@$$CBE@@YAPEBEPEBE0@Z)
该项目是一个新创建的Visual Studio 2022 c空项目,定义了_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS以允许编译(否则我会在c23中得到一个已弃用的功能编译错误)
以下是我的源文件:

#pragma warning(disable:4146)
#include <llvm/IR/IRBuilder.h>

int main()
{
    std::unique_ptr<llvm::LLVMContext> TheContext;
    return 0;
}

字符串
我试着用c++14/17/20和23/newest编译,每次都得到同样的错误。
更多信息:

  • Windows SDK:10.0
  • 平台工具集:Visual Studio 2022(v143)
  • vcpkg AutoLink设置为True
  • 我有其他来自vcpkg的包可以工作

相关问题