LLVM 教程 --system-libs 不存在
LLVM tutorial --system-libs does not exist
我一直在研究LLVM的万花筒教程,并且在编译它时遇到了无穷无尽的问题。 在下面的教程中,似乎 llvm-config 不存在标志"--system-libs"(它只是打印出一个使用块)。 我尝试将其排除在外,但它似乎是链接器错误的兔子洞,这让我相信我刚刚设置了完全错误的开发环境。 我已经在OSX Yosemite和Ubuntu上尝试过,结果相似。 未找到的错误可以通过添加 -I [llvm 路径] 来解决,但这只会暴露更多错误,使我认为这是错误的方法。
http://llvm.org/releases/3.6.0/docs/tutorial/LangImpl3.html
$make
#clang++ -g -v -L -std=c++11 -O3 toy.cpp -I/usr/include/llvm-3.5/ `llvm-config --cxxflags --ldflags --libs all` -o toy
clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core` -o toy
usage: llvm-config <OPTION>... [<COMPONENT>...]
Get various configuration information needed to compile programs which use
LLVM. Typically called from 'configure' scripts. Examples:
llvm-config --cxxflags
llvm-config --ldflags
llvm-config --libs engine bcreader scalaropts
Options:
--version Print LLVM version.
--prefix Print the installation prefix.
--src-root Print the source root LLVM was built from.
--obj-root Print the object root used to build LLVM.
--bindir Directory containing LLVM executables.
--includedir Directory containing LLVM headers.
--libdir Directory containing LLVM libraries.
--cppflags C preprocessor flags for files that include LLVM headers.
--cflags C compiler flags for files that include LLVM headers.
--cxxflags C++ compiler flags for files that include LLVM headers.
--ldflags Print Linker flags.
--libs Libraries needed to link against LLVM components.
--libnames Bare library names for in-tree builds.
--libfiles Fully qualified library filenames for makefile depends.
--components List of all possible components.
--targets-built List of all targets currently built.
--host-target Target triple used to configure LLVM.
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
Typical components:
all All LLVM libraries (default).
engine Either a native JIT or a bitcode interpreter.
toy.cpp:1:10: fatal error: 'llvm/IR/Verifier.h' file not found
#include "llvm/IR/Verifier.h"
^
1 error generated.
make: *** [parser] Error 1
事实证明,我正在使用的llvm-config版本已经过时了。 在 Ubuntu 上我可以apt-get install llvm-config-3.6
,在 OSX 上我可以做一个brew install homebrew/versions/llvm36
。 最后使用 llvm-config-3.6 而不仅仅是 llvm-config。
相关文章:
- 我们可以访问一个不存在的联盟的成员吗
- C++:对不存在的命名空间使用命名空间指令
- g++ 说函数不存在,即使包含正确的标头
- 显式 std::exception_ptr 转换为 bool 不存在.VS2010 错误?
- C++ 尝试在不存在的构造函数中引用已删除的函数(使用 rapidJson)
- 查找第一个数组中不存在的元素
- 查找不存在的键时,unordered_map返回什么
- 如何优化代码以返回最接近给定整数的数字,但给定列表中不存在?
- set::find 查找不存在的元素
- 有没有办法将字符串添加到 Vector 中,但前提是它尚不存在?->C++
- inet_ntop返回不存在的地址
- CPP 使用不存在的键访问映射
- 为什么QMediaGaplessPlaybackControl不存在?
- 如果键不存在,使用 [] 运算符访问 STL Map 元素会添加新元素
- 标记未定义的颜色,并且颜色匹配系统中不存在样品
- 为什么minhook库目录不存在
- 为什么 std::vector::p ush_front() 不存在?
- 不存在从"Magick::Color"到"MagickCore::Quantum"的合适转换功能
- 为什么 MDI 子窗口在WM_NCCREATE后不存在?
- LLVM 教程 --system-libs 不存在