LLVM:';第一个函数';教程不适合我

LLVM:';第一个函数';教程不适合我,llvm,Llvm,我正在开发一个Ubuntu 13.10 64位操作系统。 我已经下载并用make构建了LLVM3.4。 编译器:GCC4.8.1 外壳:zsh 在配置过程中,a使用了默认前缀/usr/local/。我没有使用任何其他自定义选项 源代码和版本位于我的主文件夹中: ~/llvm_workdir/build ~/llvm_workdir/llvm 当我尝试这项技术时,我遇到了一大堆问题。第一个问题与他们在源代码树中做了一些更改有关。他们在IR目录中移动了一些头文件(例如Function.h)。(本教

我正在开发一个Ubuntu 13.10 64位操作系统。 我已经下载并用make构建了LLVM3.4。 编译器:GCC4.8.1 外壳:zsh

在配置过程中,a使用了默认前缀
/usr/local/
。我没有使用任何其他自定义选项

源代码和版本位于我的主文件夹中:

~/llvm_workdir/build
~/llvm_workdir/llvm
当我尝试这项技术时,我遇到了一大堆问题。第一个问题与他们在源代码树中做了一些更改有关。他们在IR目录中移动了一些头文件(例如Function.h)。(本教程针对的是llvm的2.4版本。)我更正了教程源代码文件中的包含内容,新错误出现了。第一类是这样的:

1]
zsh: command not found: llvm-config : I'm using the `zsh shell`, which is compatible with bash.

2]
In file included from /usr/include/llvm/Support/type_traits.h:20:0,
from /usr/include/llvm/ADT/StringRef.h:13,
from /usr/include/llvm/PassRegistry.h:20,
from /usr/include/llvm/PassSupport.h:26,
from /usr/include/llvm/Pass.h:366,
from /usr/include/llvm/PassManager.h:20,
from tut1_first_function.cpp:6:
/usr/include/llvm/Support/DataTypes.h:49:3: **error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"**
^
/usr/include/llvm/Support/DataTypes.h:53:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
 # error "Must #define __STDC_CONSTANT_MACROS before " \

3]
In file included from /usr/include/llvm/ADT/SmallVector.h:19:0,
from /usr/include/llvm/PassAnalysisSupport.h:22,
from /usr/include/llvm/Pass.h:367,
from /usr/include/llvm/PassManager.h:20,
from tut1_first_function.cpp:6:
/usr/include/llvm/Support/MathExtras.h: In function ‘bool llvm::isInt(int64_t)’:
/usr/include/llvm/Support/MathExtras.h:259: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]
return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));**
我不知道在get中传递什么其他参数。我是LLVM的新手,现在开始学习。我还没有找到任何与新LLVM版本对应的新教程


如何解决上述问题?有解决办法吗?

LLVM正在积极开发中。试图将2.4版(已有5年多历史)编写的教程应用到最新版本将是一个令人沮丧的教训


是最新的,通常在新版本中保持不变,因此我建议改用它。特别是,它似乎涵盖了您链接的页面中的主题。

谢谢。我会试试看,我会来接受你的回答这与第一个函数教程不同:
tut1_first_function.cpp:44:26: note: candidate is:
In file included from /usr/include/llvm/IR/GlobalValue.h:22:0,
from /usr/include/llvm/IR/Function.h:25,
from /usr/include/llvm/IR/Module.h:19,
from tut1_first_function.cpp:7:
/usr/include/llvm/IR/DerivedTypes.h:58:23: note: static llvm::IntegerType* **llvm::IntegerType::get(llvm::LLVMContext&, unsigned int)
static IntegerType *get(LLVMContext &C, unsigned NumBits);
                       ^
/usr/include/llvm/IR/DerivedTypes.h:58:23: note:   candidate expects 2 arguments, 1 provided**