Errors in using clang libs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors in using clang libs

Chen
I used the following command to compile test.cpp which calls some libs of clang.

clang++ -I/home/chen/workspace/llvm/include -I/home/chen/workspace/llvm/tools/clang/include -L/home/chen/workspace/llvm/Debug+Asserts/lib -o test test.cpp -lclangFrontend -lclangParse -lclangSema -lclangAnalysis -lclangAST -lclangLex -lclangBasic -lclangDriver -lclangSerialization -lclangEdit -lLLVMMC -lLLVMSupport -lclangRewrite

HOWEVER, SOME ERRORS OCCUR as follows:

In file included from test.cpp:55:
In file included from /home/chen/workspace/llvm/include/llvm/Support/Host.h:17:
In file included from /home/chen/workspace/llvm/include/llvm/ADT/StringMap.h:18:
In file included from /home/chen/workspace/llvm/include/llvm/Support/Allocator.h:18:
In file included from /home/chen/workspace/llvm/include/llvm/Support/MathExtras.h:17:
In file included from /home/chen/workspace/llvm/include/llvm/Support/SwapByteOrder.h:18:
/home/chen/workspace/llvm/include/llvm/Support/DataTypes.h:49:3: error: "Must
      #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
  ^
/home/chen/workspace/llvm/include/llvm/Support/DataTypes.h:53:3: error: "Must
      #define __STDC_CONSTANT_MACROS before "         "#including
      Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
  ^
In file included from test.cpp:55:
In file included from /home/chen/workspace/llvm/include/llvm/Support/Host.h:17:
In file included from /home/chen/workspace/llvm/include/llvm/ADT/StringMap.h:18:
In file included from /home/chen/workspace/llvm/include/llvm/Support/Allocator.h:18:
/home/chen/workspace/llvm/include/llvm/Support/MathExtras.h:38:24: error: use of
      undeclared identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));

I did not find out the reason.
Please help me to figure it out. Thanks a lot!
Reply | Threaded
Open this post in threaded view
|

Re: Errors in using clang libs

Eric Christopher-2

On Sep 5, 2012, at 5:58 PM, Chen <[hidden email]> wrote:

I did not find out the reason. 
Please help me to figure it out. Thanks a lot!

Have you thought about defining the macros that were requested?

-eric

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Errors in using clang libs

Chen
I thought that the macros should have been defined in some header files.
But the compiler did not find them in the included paths.
Reply | Threaded
Open this post in threaded view
|

Re: Errors in using clang libs

Eric Christopher-2

On Sep 5, 2012, at 6:07 PM, Chen <[hidden email]> wrote:

> I thought that the macros should have been defined in some header files.
> But the compiler did not find them in the included paths.
>

No, they're defined on the command line. Look in the makefile.

-eric
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev