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

arrowdodger 6yearold at gmail.com
Sat Apr 23 06:39:44 PDT 2011


On Sat, Apr 23, 2011 at 10:51 AM, kobe James <god.son2046 at yahoo.com.cn>wrote:

> 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
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
Use llvm-config script to set your compiler flags. Or just add
"-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" to it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110423/9b1ec284/attachment.html>


More information about the cfe-dev mailing list