Skip to content

Problem with Make #4

@algorys

Description

@algorys

Hello,
I begin to learn how to use clang and I've download your example by git. I'm trying to "make" but I've some error like this :

[code]
llvm[0]: Compiling Example.cpp for Debug+Asserts build
Example.cpp:107:26: error: conflicting return type specified for ‘virtual clang::ASTConsumer* ExampleFrontendAction::CreateASTConsumer(clang::CompilerInstance&, llvm::StringRef)’
virtual ASTConsumer CreateASTConsumer(CompilerInstance &CI, StringRef file) {
^
In file included from /home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Frontend/FrontendActions.h:13:0,
from Example.cpp:7:
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Frontend/FrontendAction.h:64:40: error: overriding ‘virtual std::unique_ptrclang::ASTConsumer clang::FrontendAction::CreateASTConsumer(clang::CompilerInstance&, llvm::StringRef)’
virtual std::unique_ptr CreateASTConsumer(CompilerInstance &CI,
^
Example.cpp: In function ‘int main(int, const char
_)’:
Example.cpp:116:38: error: no matching function for call to ‘clang::tooling::CommonOptionsParser::CommonOptionsParser(int&, const char__&)’
CommonOptionsParser op(argc, argv);
^
Example.cpp:116:38: note: candidates are:
In file included from Example.cpp:9:0:
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/CommonOptionsParser.h:73:3: note: clang::tooling::CommonOptionsParser::CommonOptionsParser(int&, const char__, llvm::cl::OptionCategory&, const char_)
CommonOptionsParser(int &argc, const char *argv,
^
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/CommonOptionsParser.h:73:3: note: candidate expects 4 arguments, 2 provided
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/CommonOptionsParser.h:63:7: note: clang::tooling::CommonOptionsParser::CommonOptionsParser(clang::tooling::CommonOptionsParser&&)
class CommonOptionsParser {
^
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/CommonOptionsParser.h:63:7: note: candidate expects 1 argument, 2 provided
Example.cpp:121:76: error: no matching function for call to ‘clang::tooling::ClangTool::run(std::unique_ptrclang::tooling::FrontendActionFactory)’
int result = Tool.run(newFrontendActionFactory());
^
Example.cpp:121:76: note: candidate is:
In file included from Example.cpp:10:0:
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/Tooling.h:286:7: note: int clang::tooling::ClangTool::run(clang::tooling::ToolAction
)
int run(ToolAction Action);
^
/home/mea/Documents/llvm/llvm/tools/clang/tools/example/../../include/clang/Tooling/Tooling.h:286:7: note: no known conversion for argument 1 from ‘std::unique_ptrclang::tooling::FrontendActionFactory’ to ‘clang::tooling::ToolAction

/bin/rm: cannot remove ‘/home/mea/Documents/llvm/llvm/tools/clang/tools/example/Debug+Asserts/Example.d.tmp’: No such file or directory
make: *** [/home/mea/Documents/llvm/llvm/tools/clang/tools/example/Debug+Asserts/Example.o] Error 1
[/code]

Can you help me to solve this please ?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions