firolino / clang-tool

Simple and powerful standalone project for clang-based tools using libtooling (e.g. refactoring, auto-completion, etc.)
MIT License
46 stars 9 forks source link

build error #1

Closed nfsdaemon closed 3 years ago

nfsdaemon commented 4 years ago

clang-tool/build$make Scanning dependencies of target clang-tool [ 11%] Building CXX object src/CMakeFiles/clang-tool.dir/main.cc.o [ 22%] Building CXX object src/CMakeFiles/clang-tool.dir/utils/utils.cc.o /var/tmp/clang/clang-tool/src/utils/utils.cc: In function 'bool utils::customRunToolOnCodeWithArgs(clang::FrontendAction, const llvm::Twine&, const std::vector<std::__cxx11::basic_string >&, const llvm::Twine&, const FileContentMappings&)': /var/tmp/clang/clang-tool/src/utils/utils.cc:28:116: error: no matching function for call to 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, clang::FrontendAction&, clang::FileManager)' 28 | clang::tooling::ToolInvocation invocation(getSyntaxOnlyToolArgs(args, fileNameRef), frontendAction, files.get()); | ^ In file included from /var/tmp/clang/clang-tool/src/utils/utils.h:11, from /var/tmp/clang/clang-tool/src/utils/utils.cc:1: /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:257:3: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, clang::tooling::ToolAction, clang::FileManager, std::shared_ptr)' 257 | ToolInvocation(std::vector CommandLine, ToolAction Action, | ^~~~~~ /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:257:3: note: candidate expects 4 arguments, 3 provided /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:245:3: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, std::unique_ptr, clang::FileManager, std::shared_ptr)' 245 | ToolInvocation(std::vector CommandLine, | ^~~~~~ /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:246:50: note: no known conversion for argument 2 from 'clang::FrontendAction' to 'std::unique_ptr' 246 | std::unique_ptr FAction, FileManager *Files, | ~~~~~~^~~~~ /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:232:7: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(const clang::tooling::ToolInvocation&)' 232 | class ToolInvocation { | ^~~~~~ /usr/lib/llvm/11/include/clang/Tooling/Tooling.h:232:7: note: candidate expects 1 argument, 3 provided make[2]: [src/CMakeFiles/clang-tool.dir/build.make:122: src/CMakeFiles/clang-tool.dir/utils/utils.cc.o] Error 1 make[1]: [CMakeFiles/Makefile2:114: src/CMakeFiles/clang-tool.dir/all] Error 2 make: *** [Makefile:104: all] Error 2

Hello I tried to build your project but I reached an error. Is there easy way to fix it? I understand that a year and a half has passed since the publication and the clang api has changed, but still I cannot fix the error myself.

firolino commented 4 years ago

Hi, thanks for reporting the issue. I just uploaded the fix for newer clang versions. Could you try building it again?