On Sat, Apr 23, 2011 at 10:51 AM, kobe James <span dir="ltr"><<a href="mailto:god.son2046@yahoo.com.cn">god.son2046@yahoo.com.cn</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div style="font-family:verdana,helvetica,sans-serif;font-size:10pt"><div>Hi,<br><br>I installed Clang on my machine. It successed to compile a simple C file.<br><br>Then I tried to compile the clang-wpa.cpp file but got the following errors:<br>

==============================<br>In file included from clang-wpa.cpp:15:<br>In file included from /usr/local/include/clang/Basic/FileManager.h:20:<br>In file included from /usr/local/include/llvm/ADT/StringMap.h:18:<br>
In file included from /usr/local/include/llvm/Support/Allocator.h:18:<br>
In file included from /usr/local/include/llvm/Support/MathExtras.h:17:<br>In file included from /usr/local/include/llvm/Support/SwapByteOrder.h:18:<br>/usr/local/include/llvm/Support/DataTypes.h:45:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"<br>

# error "Must #define __STDC_LIMIT_MACROS before
 #including System/DataTypes.h"<br>  ^<br>/usr/local/include/llvm/Support/DataTypes.h:49:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"<br># error "Must #define __STDC_CONSTANT_MACROS before " \<br>

  ^<br>In file included from clang-wpa.cpp:15:<br>In file included from /usr/local/include/clang/Basic/FileManager.h:20:<br>In file included from /usr/local/include/llvm/ADT/StringMap.h:18:<br>In file included from /usr/local/include/llvm/Support/Allocator.h:18:<br>

/usr/local/include/llvm/Support/MathExtras.h:38:24: error: use of undeclared identifier 'INT64_C'<br>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));<br>                       ^<br>

/usr/local/include/llvm/Support/MathExtras.h:38:56: error: use of undeclared identifier
 'INT64_C'<br>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));<br>                                                       ^<br>/usr/local/include/llvm/Support/MathExtras.h:57:26: error: use of undeclared identifier 'UINT64_C'<br>

  return N >= 64 || x < (UINT64_C(1)<<N);<br>                         ^<br>/usr/local/include/llvm/Support/MathExtras.h:82:24: error: use of undeclared identifier 'INT64_C'<br>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x <
 (INT64_C(1)<<(N-1)));<br>                       ^<br>/usr/local/include/llvm/Support/MathExtras.h:82:56: error: use of undeclared identifier 'INT64_C'<br>  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));<br>

                                                       ^<br>7 errors generated.<br><br>======================================<br>Do you know what the problem is here?<br><br>Thanks,<br>Chen<br><br></div>
</div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br>Use llvm-config script to set your compiler flags. Or just add "-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" to it.<br>