[LLVMdev] The first two lines of llvm tutorial don't compile.

Thomas Hudson hudson at speakeasy.net
Mon Jun 2 09:52:16 PDT 2008


You need to use the script 'llvm-config' to pass correct arguments to g 
++:

g++ -o broken.o `llvm-config --cxxflags` broken.cpp


On Jun 2, 2008, at 9:43 AM, Hendrik Boom wrote:

> I took the first two lines of the sample program in the tutorial:
>
>
> hendrik at lovesong:~/dv/lang/hlvm$ cat broken.cpp
> #include "llvm/DerivedTypes.h"
> #include "llvm/Module.h"
> hendrik at lovesong:~/dv/lang/hlvm$
>
>
> and tried to compile them using the llvm-dev in Debian testing:
>
>
> hendrik at lovesong:~/dv/lang/hlvm$ g++ -o broken.o -c broken.cpp
> In file included from /usr/include/llvm/Type.h:16,
>                 from /usr/include/llvm/DerivedTypes.h:21,
>                 from broken.cpp:1:
> /usr/include/llvm/Support/DataTypes.h:38:3: error: #error "Must  
> #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
> hendrik at lovesong:~/dv/lang/hlvm$
>
>
> Did I do something wrong, or is something broken? In llvm or in g++?
>
>
> hendrik at lovesong:~/dv/lang/hlvm$ g++ --version
> g++ (GCC) 4.2.4 (Debian 4.2.4-1)
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There  
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
>
> hendrik at lovesong:~/dv/lang/hlvm$
>
>
>
> -- hendrik
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list