[cfe-dev] Problem in code generation with LLVM using clang

Era Jain era at cse.iitk.ac.in
Sun Oct 21 12:56:07 PDT 2012


Hi,

I am completely new to LLVM and to begin with, I am writing a basic
pass(the Hello World Pass).
I am trying to compile Hello.cpp using clang++ using the following command:

>  *clang -S -emit-llvm -I/home/lera/llvm/include Hello.cpp -o Hello.bc*

and get the following errors:

*In file included from Hello.cpp:1:
In file included from /home/era/llvm/include/llvm/Pass.h:373:
In file included from /home/era/llvm/include/llvm/PassSupport.h:25:
In file included from /home/era/llvm/include/llvm/PassRegistry.h:20:
In file included from /home/era/llvm/include/llvm/ADT/StringRef.h:13:
In file included from /home/era/llvm/include/llvm/Support/type_traits.h:20:
/home/era/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/era/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 Hello.cpp:2:
In file included from /home/era/llvm/include/llvm/Function.h:24:
In file included from /home/era/llvm/include/llvm/Argument.h:18:
In file included from /home/era/llvm/include/llvm/Attributes.h:18:
/home/era/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)));
                       ^
/home/era/llvm/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)));
                                                       ^
/home/era/llvm/include/llvm/Support/MathExtras.h:64:26: error: use of
undeclared
      identifier 'UINT64_C'
  return N >= 64 || x < (UINT64_C(1)<<N);
                         ^
/home/era/llvm/include/llvm/Support/MathExtras.h:96:24: error: use of
undeclared
      identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                       ^
/home/era/llvm/include/llvm/Support/MathExtras.h:96: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.

*Can anyone help me with this?? Any help would be appreciated. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121022/67210a9c/attachment.html>


More information about the cfe-dev mailing list