[LLVMdev] The first two lines of llvm tutorial don't compile.
Hendrik Boom
hendrik at topoi.pooq.com
Mon Jun 2 10:10:33 PDT 2008
On Mon, 02 Jun 2008 09:52:16 -0700, Thomas Hudson wrote:
> You need to use the script 'llvm-config' to pass correct arguments to g
> ++:
>
> g++ -o broken.o `llvm-config --cxxflags` broken.cpp
>
>
Interesting. When I type the command as you provided it (using cut-and-paste) I get:
hendrik at lovesong:~/dv/lang/hlvm$ g++ -o broken.o `llvm-config --cxxflags` broken.cpp
g++: (Debian: No such file or directory
g++: 2.2-7): No such file or directory
hendrik at lovesong:~/dv/lang/hlvm$
So I execute the script by itself, and get
hendrik at lovesong:~/dv/lang/hlvm$ llvm-config --cxxflags
-I/usr/include/llvm -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -O2 -fomit-frame-pointer -DLLVM_DEBIAN_INFO= (Debian 2.2-7) -Woverloaded-virtual
hendrik at lovesong:~/dv/lang/hlvm$
Putting that output into the command, and removing the
-DLLVM_DEBIAN_INFO= (Debian 2.2-7) from it, things work
as well as one might expect for a program without main():
hendrik at lovesong:~/dv/lang/hlvm$ g++ -o broken.o -I/usr/include/llvm -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -O2 -fomit-frame-pointer -Woverloaded-virtual broken.cpp/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
hendrik at lovesong:~/dv/lang/hlvm$
Do you suppose a bug should be logged against the Debian package?
-- hendrik
More information about the llvm-dev
mailing list