就像每个新人尝试使用Clang构建内容一样,使用此处的教程:
我可以使用此命令构建第1和第2个教程:
export CLANG_LIBS="-lclangTooling -lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization -lclangCodeGen -lclangParse -lclangSema -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangAnalysis -lclangARCMigrate -lclangRewrite -lclangRewriteFrontend -lclangEdit -lclangAST -lclangLex -lclangBasic -lclang"
并编译:
g++ `llvm-config --cxxflags --ldflags ` tool.cpp $CLANG_LIBS `llvm-config --libs --system-libs` -o tool
它有效!当我使用相同的命令进入教程3时,我得到以下错误:
tutorial3.cpp: In function ‘int main()’: tutorial3.cpp:85:24: error: invalid initialization of reference of type ‘const clang::PCHContainerReader&’ from expression of type ‘clang::FrontendOptions’ frontendOptions); ^ In file included from tutorial3.cpp:18:0: /usr/local/include/clang/Frontend/Utils.h:66:6: note: in passing argument 3 of ‘void clang::InitializePreprocessor(clang::Preprocessor&, const clang::PreprocessorOptions&, const clang::PCHContainerReader&, const clang::FrontendOptions&)’ void InitializePreprocessor(Preprocessor &PP, const PreprocessorOptions &PPOpts,
请有人帮帮我吗?还有任何已知的clang用户群?我试过google群组,但没有找到任何!感谢