[LLVMdev] Error when building tutorial example

Óscar Fuentes ofv at wanadoo.es
Sun Sep 20 23:32:28 PDT 2009

Alexia Benington <alexbenington at gmail.com> writes:

> Hi all,
> I'm a new user to LLVM. Not really sure if this is the correct place
> to post, since there isn't really any other forums around. Anyway, the
> issue I'm encountering is that, I was trying out the first tutorial
> (http://llvm.org/docs/tutorial/JITTutorial1.html). I attempted to do
> this in another folder that was copied from llvm/projects/sample. I
> created a new folder called "tut1" in sample/tools/ folder, and the
> following Makefile.
> LEVEL=../..
> LINK_COMPONENTS += --cxxflags
> LINK_COMPONENTS += --ldflags

Remove the previous three LINK_COMPONENTS lines. LINK_COMPONENTS is for
names of LLVM components (roughly equivalent to libraries) that should
be linked to your project. It is equivalent to the names you put after
--libs on your invocation of llvm-config below.


you can fuse the previous two lines on a single one:

LINK_COMPONENTS += core engine

> include $(LEVEL)/Makefile.common
> However, I'm getting the following error on gmake.
> gmake[2]: *** No rule to make target `-I/usr/src/llvm/include', needed
> by `/sample/Release/bin/tut1'.  Stop.
> I can get it to compile with the following command. But I want to make
> sure I understand how the Makefiles integrate together.
> g++ tut1.cpp `llvm-config --cxxflags --ldflags --libs core engine`
> Really appreciate your help. Thank you.


More information about the llvm-dev mailing list