I try to compile the minimal example from here
#include <llvm/IR/Module.h>
#include <llvm/IRReader/IRReader.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/Support/SourceMgr.h>
using namespace llvm;
int main()
{
LLVMContext context;
SMDiagnostic error;
Module *m = parseIRFile("hello.bc", error, context);
if(m)
{
m->dump();
}
return 0;
}
using
g++ myFile.cpp `llvm-config --cxxflags --ldflags --libs all --system-libs` -std=c++11 -ldl -lpthread
and get
error: cannot convert ‘std::unique_ptr’ to ‘llvm::Module*’ in initialization
All examples and the llvm source itself everywhere uses llvm::Module *; so why do I get this error?
Note I use: LLVMVersion=3.6.0svn LLVM_CONFIGTIME= Thu Dec 18 10:51:37 CET 2014 Is it a problem with the 3.6 trunk? Should I opt for 3.5 branch?
Thx Alex