[LLVMdev] compiling the tutorial

Óscar Fuentes ofv at wanadoo.es
Fri Nov 21 00:56:58 PST 2008

Carlo Alberto Ferraris <cafxx at strayorange.com> writes:

>>> I'm investigating adding LLVM JIT support to a project of mine, but
>>> I'm having issues when trying to compile the Kaleidoscope tutorial*
>>> under MSVC 2008.
>>> In particular, the problem is that in main() when this line is executed
>>>>   // Create the JIT.
>>>>   TheExecutionEngine = ExecutionEngine::create(TheModule);
>>> create returns null, because both JITCtor and InterpCtor are null.
>>> I found this comment in ExecutionEngine.h
>> Does it work if you add to the link command
>> /INCLUDE:_X86TargetMachineModule
>> ?
>> [snip]
> I tried linking the tutorial adding that command but JITCtor and
> InterpCtor are still null, both in debug and release builds.
> Was by any chance that command meant to be used when building the llvm
> solution?

No, that directive is not needed for building the libraries, it is
used for forcing the linker to include into the executable some global
objects that register themselves. The _X86TargetMachineModule is for the
x86 target.

Does the Fibonacci example works? (look into examples/Fibonacci). It
uses the JIT too. Look at its project settings and try using the same
ones on your project.


More information about the llvm-dev mailing list