[cfe-dev] Fail to compile clang-wpa.cpp

kobe James god.son2046 at yahoo.com.cn
Fri Apr 22 23:51:05 PDT 2011


Hi,

I installed Clang on my machine. It successed to compile a simple C file.

Then I tried to compile the clang-wpa.cpp file but got the following errors:
==============================
In file included from clang-wpa.cpp:15:
In file included from /usr/local/include/clang/Basic/FileManager.h:20:
In file included from /usr/local/include/llvm/ADT/StringMap.h:18:
In file included from /usr/local/include/llvm/Support/Allocator.h:18:
In file included from /usr/local/include/llvm/Support/MathExtras.h:17:
In file included from /usr/local/include/llvm/Support/SwapByteOrder.h:18:
/usr/local/include/llvm/Support/DataTypes.h:45:3: error: #error "Must #define 
__STDC_LIMIT_MACROS before #including System/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"
  ^
/usr/local/include/llvm/Support/DataTypes.h:49:3: error: #error "Must #define 
__STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
  ^
In file included from clang-wpa.cpp:15:
In file included from /usr/local/include/clang/Basic/FileManager.h:20:
In file included from /usr/local/include/llvm/ADT/StringMap.h:18:
In file included from /usr/local/include/llvm/Support/Allocator.h:18:
/usr/local/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)));
                       ^
/usr/local/include/llvm/Support/MathExtras.h:38:56: error: use of undeclared 
identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                                                       ^
/usr/local/include/llvm/Support/MathExtras.h:57:26: error: use of undeclared 
identifier 'UINT64_C'
  return N >= 64 || x < (UINT64_C(1)<<N);
                         ^
/usr/local/include/llvm/Support/MathExtras.h:82:24: error: use of undeclared 
identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                       ^
/usr/local/include/llvm/Support/MathExtras.h:82:56: error: use of undeclared 
identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                                                       ^
7 errors generated.

======================================
Do you know what the problem is here?

Thanks,
Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110423/4a71a5c7/attachment.html>


More information about the cfe-dev mailing list