title: How to Compile and Run llc-3.4 generated C++ code using native compiler(g++)?
body: <h2>Note:</h2>
  
  <p>Goal of this work is to use some of the c++11 features in non c++11 compiler</p>
  
  <p>Following steps are done,</p>
  
  <ol>
  <li><p>Generate llvm bit code,</p>
  
  <pre><code>clang++ -emit-llvm -c test.cc -o test.o
  </code></pre></li>
  <li><p>Convert llvm bitcode to c++ code,</p>
  
  <pre><code>llc-3.4 test.o -o test.cpp -march=cpp
  </code></pre></li>
  <li><p>Getting below error while compiling the llvm generated c++ code using GNU g++ </p>
  
  <p>arunprasadr@geekvm:~/works/myex/llvm$ g++ test.cpp
  test.cpp:3:23: fatal error: llvm/Pass.h: No such file or directory
  compilation terminated.</p></li>
  </ol>
  
  <p>I even tried adding llvm-dev include path, but still fails,</p>
  
  <pre><code>arunprasadr@geekvm:~/works/myex/llvm$ g++ test.cpp -I/usr/include/llvm-3.4 -I /usr/include/llvm-c-3.4
  In file included from /usr/include/llvm-3.4/llvm/Support/type_traits.h:20:0,
                   from /usr/include/llvm-3.4/llvm/ADT/StringRef.h:13,
                   from /usr/include/llvm-3.4/llvm/PassRegistry.h:20,
                   from /usr/include/llvm-3.4/llvm/PassSupport.h:26,
                   from /usr/include/llvm-3.4/llvm/Pass.h:366,
                   from test.cpp:3:
  /usr/include/llvm-3.4/llvm/Support/DataTypes.h:48:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
  /usr/include/llvm-3.4/llvm/Support/DataTypes.h:52:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
  In file included from /usr/include/llvm-3.4/llvm/ADT/SmallVector.h:19:0,
                   from /usr/include/llvm-3.4/llvm/PassAnalysisSupport.h:22,
                   from /usr/include/llvm-3.4/llvm/Pass.h:367,
                   from test.cpp:3:
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h: In function ‘bool llvm::isInt(int64_t)’:
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h:264:33: error: there are no arguments to ‘INT64_C’ that depend on a template parameter, so a declaration of ‘INT64_C’ must be available [-fpermissive]
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h:264:33: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h:264:65: error: there are no arguments to ‘INT64_C’ that depend on a template parameter, so a declaration of ‘INT64_C’ must be available [-fpermissive]
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h: In function ‘bool llvm::isUInt(uint64_t)’:
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h:290:36: error: there are no arguments to ‘UINT64_C’ that depend on a template parameter, so a declaration of ‘UINT64_C’ must be available [-fpermissive]
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h: In function ‘bool llvm::isIntN(unsigned int, int64_t)’:
  /usr/include/llvm-3.4/llvm/Support/MathExtras.h:322:33: error: ‘INT64_C’ was not declared in this scope
  </code></pre>