[LLVMdev] ExecutionEngine::create returns 0

Hendrik Boom hendrik at topoi.pooq.com
Tue Jun 10 07:39:07 PDT 2008

On Tue, 10 Jun 2008 07:07:35 +0530, Mahadevan R wrote:

>> Now to compare it in detail with the much smaller program I've got and
>> maybe I'll figure out what's wrong with my call to
>> ExecutionEngine::create.
> That call is perfectly valid, actually. It works for me when linked
> with:
> g++ -o b b.o `llvm-config --ldflags` `llvm-config --libs engine jit`
> Cheers,
> -Mahadevan.

Thanks.  It's compiling and executing now.

The story appears to be this:

  llvm::ExecutionEngine::create requires particular libraries (presumably 
those that involve execution, JIT code generation, or interpretation) to 
be linked into the executable (the executable that contains the call to 
llvm::ExecutionEngine::create), or else it returns NULL.  However, 
llvm::ExecutionEngine::create does not itself contains references to 
entry-points that would cause the necessary libraries to be sought by the 
linker, so no linker failure results.

Would it be possible to include this information in the documentation for 

-- hendrik

More information about the llvm-dev mailing list