我有一个cpp文件,其中包含一些OCLint的头文件。 那些头文件内部包括clang和llvm头文件,如AST,ASTMatchers等......
我已在Build Settings中将所需的标题搜索路径指定为: -
../下载/铛+ LLVM-3.3-x86_64的-苹果darwin12 /包括
但是当我构建时,我收到以下错误: -
架构x86_64的未定义符号: " llvm :: RefCountedBaseVPTR :: anchor()",引自: 文件中的clang :: ast_matchers :: internal :: matcher_isPublic0Matcher 文件中的clang :: ast_matchers :: internal :: matcher_isProtected0Matcher 文件中的clang :: ast_matchers :: internal :: matcher_isPrivate0Matcher clang的表格:: ast_matchers :: internal :: matcher_hasAnyTemplateArgument0Matcher 在File.o中 vtable for clang :: ast_matchers :: internal :: matcher_ignoringImpCasts0Matcher in File.o vtable for clang :: ast_matchers :: internal :: matcher_ignoringParenCasts0Matcher in File.o clang :: ast_matchers :: internal :: matcher_ignoringParenImpCasts0Matcher的vtable 在File.o中 ... " llvm :: Regex :: match(llvm :: StringRef,llvm :: SmallVectorImpl )",引自: 铛:: ast_matchers ::内部:: matcher_matchesName0Matcher ::匹配(铛:: NamedDecl const&,clang :: ast_matchers :: internal :: ASTMatchFinder , 在File.o中clang :: ast_matchers :: internal :: BoundNodesTreeBuilder *)const " llvm :: Regex :: Regex(llvm :: StringRef,unsigned int)",引自: 铛:: ast_matchers ::内部:: matcher_matchesName0Matcher ::匹配(铛:: NamedDecl const&,clang :: ast_matchers :: internal :: ASTMatchFinder *,..........等 .....
我是否忘记包含一些标题搜索路径?
答案 0 :(得分:-1)
可能忘了添加依赖库。添加这些并再试一次
-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 -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMX86Desc -lLLVMX86Info - lLLVMTarget -lLLVMX86AsmPrinter -lLLVMMC -lLLVMObject -lLLVMX86Utils -lLLVMCore -lLLVMSupport