Hello everyone,
I am currently using clang tooling for a tool on my own, and I recently started to develop it again.
I have a strange error while launching my binary
I got a lot of the followin
: CommandLine Error: Argument ‘version’ defined more than once!
: CommandLine Error: Argument ‘print-all-options’ defined more than once!
: CommandLine Error: Argument ‘print-options’ defined more than once!
: CommandLine Error: Argument ‘help-hidden’ defined more than once!
: CommandLine Error: Argument ‘help’ defined more than once!
: CommandLine Error: Argument ‘help-list-hidden’ defined more than once!
: CommandLine Error: Argument ‘help-list’ defined more than once!
: CommandLine Error: Argument ‘debug-only’ defined more than once!
So I tested back the example code from file:
~/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h
Corrected for compilation errors:
#include <clang/Frontend/FrontendActions.h>
#include <clang/Tooling/Tooling.h>
#include <clang/Tooling/CommonOptionsParser.h>
#include <llvm/Support/CommandLine.h>
using namespace clang::tooling;
using namespace llvm;
static cl::extrahelp CommonHelp(CommonOptionsParser::HelpMessage);
static cl::extrahelp MoreHelp("\nMore help text…");
int main(int argc, const char **argv) {
CommonOptionsParser OptionsParser(argc, argv);
ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList());
return Tool.run(newFrontendActionFactoryclang::SyntaxOnlyAction());
}
And the errors still occurs.
I searched a little where it could came from, but I didn’t find out.
I’ll continue to search, but any help is welcome
Thanks,