公司的linux服务器是基于redhat修改的,原来安装了gcc-4.4.4,由于对c++11支持不好,因此想升级gcc。由于该机器是同事公用的,所以不想影响其他同时,在自己的目录下用gcc-5.4.0的源码进行安装。安装完成之后gcc-5.4.0下有如下几个目录:
bin 有gcc g++ c++等二进制文件,g++ -v输出版本确实为5.4.0
include 没有任何文件,经查询,发现老版本的gcc在/usr/include/c++/4.4.4/目录下能找到stl头文件
lib 一些库文件
lib64 一些库文件
libexec 一些库文件
share 其他信息
google了半天也都是说什么没加-std=c++11等等,我加上去了也不行。请大神们看看!感谢!
大家讲道理2017-04-17 14:55:16
The header file of
c++
is in a folder called c++
, search for it~~
However, there is no unordered_map.h
file, there is unordered_map
, and the header file of c++
is
without extension. If you really want to find unordered_map.h
, it may be under the bits
folder, but the name is not definitely this. It depends on how the compiler names it
伊谢尔伦2017-04-17 14:55:16
Is it just compiled without executing make install? Those header files should be copied during installation. You can install it in your own directory, but it is best to install it under /usr/local, which will not interfere with the system. And because of this, the gcc installed from the source code has a default search path of /usr/local/include.
Check whether you wrote the correct prefix during configure?