gpt4 book ai didi

c++ - 带有 llvm 和 clang 的架构 x86_64 的 undefined symbol

转载 作者:太空宇宙 更新时间:2023-11-04 14:31:50 25 4
gpt4 key购买 nike

我有一个 cpp 文件,其中包含一些 OCLint 的头文件。这些头文件内部包含 clang 和 llvm 头文件,如 AST、ASTMatchers 等...

我已经在build设置中指定了所需的 header 搜索路径:-

../Downloads/clang+llvm-3.3-x86_64-apple-darwin12/include

但是当我构建时出现以下错误:-

Undefined symbols for architecture x86_64: "llvm::RefCountedBaseVPTR::anchor()", referenced from: vtable for clang::ast_matchers::internal::matcher_isPublic0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_isProtected0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_isPrivate0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_hasAnyTemplateArgument0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_ignoringParenCasts0Matcher in File.o vtable for clang::ast_matchers::internal::matcher_ignoringParenImpCasts0Matcher in File.o ... "llvm::Regex::match(llvm::StringRef, llvm::SmallVectorImpl)", referenced from: clang::ast_matchers::internal::matcher_matchesName0Matcher::matches(clang::NamedDecl const&, clang::ast_matchers::internal::ASTMatchFinder, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in File.o "llvm::Regex::Regex(llvm::StringRef, unsigned int)", referenced from: clang::ast_matchers::internal::matcher_matchesName0Matcher::matches(clang::NamedDecl const&, clang::ast_matchers::internal::ASTMatchFinder*, .......... etc .....

我是否忘记包含一些标题搜索路径?

最佳答案

可能忘记添加依赖库了。添加这些并重试

-lLLVMCore -lLLVMSupport -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject - lLLVMCore -lLLVMSupport -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine - lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmP rinter -lLLVMMCParser -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMX86Desc -lLLVMX86Info - lLLVMTarget -lLLVMX86AsmPrinter -lLLVMMC -lLLVMObject -lLLVMX86Utils -lLLVMCore -lLLVMSupport

关于c++ - 带有 llvm 和 clang 的架构 x86_64 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24801265/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com