[cfe-dev] Problem with Tooling system

Armand Leclercq marman.email at gmail.com
Fri Nov 22 13:00:27 PST 2013


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
<premain>: CommandLine Error: Argument 'version' defined more than once!
<premain>: CommandLine Error: Argument 'print-all-options' defined more
than once!
<premain>: CommandLine Error: Argument 'print-options' defined more than
once!
<premain>: CommandLine Error: Argument 'help-hidden' defined more than once!
<premain>: CommandLine Error: Argument 'help' defined more than once!
<premain>: CommandLine Error: Argument 'help-list-hidden' defined more than
once!
<premain>: CommandLine Error: Argument 'help-list' defined more than once!
<premain>: 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(newFrontendActionFactory<clang::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,

-- 
Armand Leclercq
EPITA 2013 Assistant C/Unix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131122/954f2b7c/attachment.html>


More information about the cfe-dev mailing list