【发布时间】:2014-10-03 12:59:06
【问题描述】:
我想在 suse linux 上使用最新的 g++ 编译器(4.9.1),但 suse 只支持旧的 g++ 版本。因此,我从其中一个 gnu 镜像站点获取了最新的源代码并自己编译了它。一切都很顺利。但是当我尝试使用内置的 g++ 编译我的测试代码时,编译失败并出现错误, “/root/home/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/os_defines.h:39:22:致命错误:features.h:没有这样的文件或目录”。
我可以在“/root/home/include/c++/4.9.1/parallel”中找到一个“features.h”,但我觉得应该存在于“/root/home/include/c++/4.9.1/”本身中。
我将“/root/home/include/c++/4.9.1/parallel/features.h”复制到“/root/home/include/c++/4.9.1/ ”只是为了看看会发生什么。现在它抱怨找不到错误“whcar.h”。
我错过了什么吗?
这是我构建 g++ 所遵循的步骤。
1. /root/home/gcc_build/objdir# ../gcc-4.9.1/configure --prefix=/root/home/ --disable-multilib
2. /root/home/gcc_build/objdir# make -j16
3. /root/home/gcc_build/objdir# make install
4. /root/home/gcc_build/test# /root/home/bin/g++ --sysroot /root/home -m64 test.cpp
【问题讨论】:
-
您是执行安装以添加前缀还是仅复制可执行文件?
-
@Tanuki 我不知道 OP 做了什么,但是安装到前缀 not 解决了这个问题。