当前位置: 技术问答>linux和unix
不能编译C++
来源: 互联网 发布时间:2015-07-07
本文导语: 前分帖子我是不能编译C,但经过了看lfs明白了,装好了,现在又出现了不能编译C++, 错误信息如下: In file included from /usr/include/bits/posix1_lim.h:126, from /usr/include/limits.h:144, from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/limits.h...
前分帖子我是不能编译C,但经过了看lfs明白了,装好了,现在又出现了不能编译C++,
错误信息如下:
In file included from /usr/include/bits/posix1_lim.h:126,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/limits.h:132,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/syslimits.h:7,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/limits.h:11,
from /usr/include/c++/3.2/climits:49,
from /usr/include/c++/3.2/bits/localefwd.h:47,
from /usr/include/c++/3.2/ios:48,
from /usr/include/c++/3.2/ostream:45,
from /usr/include/c++/3.2/iostream:45,
from hello.cxx:1:
/usr/include/bits/local_lim.h:36:26:linux/limits.h:没有这个文件
或目录
In file include from /usr/include/errno.h:36,
from /usr/include/c++/3.2/cerrno:48,
from /usr/include/c++/3.2/bits/local_facets.tcc:38,
from /usr/include/c++/3.2/local:46,
from /usr/include/c++/3.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2/ostream:275,
from /usr/include/c++/3.2/iostream:45,
from hell.cxx:1:
/usr/include/bits/errno.h:25:26:linux/errno.h:没有这个文件
或目录
谢谢大家来帮忙解决一下,初学linux!
错误信息如下:
In file included from /usr/include/bits/posix1_lim.h:126,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/limits.h:132,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/syslimits.h:7,
from /usr/lib/gcc-lib/i386-pc-linux/3.2/include/limits.h:11,
from /usr/include/c++/3.2/climits:49,
from /usr/include/c++/3.2/bits/localefwd.h:47,
from /usr/include/c++/3.2/ios:48,
from /usr/include/c++/3.2/ostream:45,
from /usr/include/c++/3.2/iostream:45,
from hello.cxx:1:
/usr/include/bits/local_lim.h:36:26:linux/limits.h:没有这个文件
或目录
In file include from /usr/include/errno.h:36,
from /usr/include/c++/3.2/cerrno:48,
from /usr/include/c++/3.2/bits/local_facets.tcc:38,
from /usr/include/c++/3.2/local:46,
from /usr/include/c++/3.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2/ostream:275,
from /usr/include/c++/3.2/iostream:45,
from hell.cxx:1:
/usr/include/bits/errno.h:25:26:linux/errno.h:没有这个文件
或目录
谢谢大家来帮忙解决一下,初学linux!
|
一定是编译器安装的问题
|
可能缺少或者定义错了某些宏、预编译选项等
|
用g++ 编译
|
我试了一下可以啊,楼主!
|
g++ 安装得有问题吧?
|
找到configure.in文件所在目录
运行./configure
应该可以的了
运行./configure
应该可以的了
|
g++ -o hello heloo.cpp
|
我也碰到了这个问题,不能使用cout,可以使用printf,奇怪阿
|
注意环境变量阿