[cfe-dev] Errors in using clang libs

Chen mr.zhechen at gmail.com
Wed Sep 5 17:58:23 PDT 2012


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!



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Errors-in-using-clang-libs-tp4026544.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list