首页 新闻 会员 周边 捐助

gcc编译器问题,终极提问

0
悬赏园豆:140 [已关闭问题] 关闭于 2016-06-08 15:53

今天编译安装mariadb,真是各种不顺,直接上问题:

CMAKE版本:最新 3.41

GCC版本:最新5.30,

/usr/bin/c++ -v 提示:

 

[root@localhost ~]# /usr/bin/c++ -v
使用内建 specs。
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
目标:x86_64-unknown-linux-gnu
配置为:../configure --prefix=/usr --disable-multilib --enable-languages=c,c++,java
线程模型:posix
gcc 版本 5.3.0 (GCC)

 

 

进入mariadb源目录,开始 cmake的时候就报错,完整保存如下:

-- Performing Test HAVE_C__Wshadow
-- Performing Test HAVE_C__Wshadow - Success
-- Performing Test HAVE_CXX__Wshadow
-- Performing Test HAVE_CXX__Wshadow - Failed
-- Performing Test HAVE_STDCXX11
-- Performing Test HAVE_STDCXX11 - Failed
-- Performing Test HAVE_STDCXX0X
-- Performing Test HAVE_STDCXX0X - Failed
CMake Error at storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake:180 (message):
/usr/bin/c++ doesn't support -std=c++11 or -std=c++0x, you need one that
does.
Call Stack (most recent call first):
storage/tokudb/PerconaFT/CMakeLists.txt:35 (include)


-- Configuring incomplete, errors occurred!
See also "/usr/src/db/mariadb-10.1.10/CMakeFiles/CMakeOutput.log".
See also "/usr/src/db/mariadb-10.1.10/CMakeFiles/CMakeError.log".

 

 

 

查看cmake的错误日志如下:

Run Build Command:"/usr/bin/gmake" "cmTC_0a678/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_0a678.dir/build.make CMakeFiles/cmTC_0a678.dir/build
gmake[1]: Entering directory `/usr/src/db/mariadb-10.1.10/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0a678.dir/src.cxx.o
/usr/bin/c++ -Wall -Werror -pie -fPIC -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -DWITH_INNODB_DISALLOW_WRITES -fno-exceptions -fno-rtti -Wno-vla -Wno-missing-field-initializers -Wno-missing-field-initializers -Wstrict-null-sentinel -Winit-self -Wswitch -Wtrampolines -Wlogical-op -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-ignored-attributes -fno-rtti -fno-exceptions -Wpacked -fno-omit-frame-pointer -Wno-error=strict-overflow -Wextra -Wbad-function-cast -Wpointer-arith -Wmissing-format-attribute -Wcast-align -DHAVE_STDCXX0X -std=c++0x -o CMakeFiles/cmTC_0a678.dir/src.cxx.o -c /usr/src/db/mariadb-10.1.10/CMakeFiles/CMakeTmp/src.cxx
cc1plus: error: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [-Werror]
cc1plus: error: unrecognized command line option '-Wno-ignored-attributes' [-Werror]
cc1plus: all warnings being treated as errors
gmake[1]: *** [CMakeFiles/cmTC_0a678.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory `/usr/src/db/mariadb-10.1.10/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_0a678/fast] Error 2

 

 

确实没法了,求助求助  

扶苏丶的主页 扶苏丶 | 初学一级 | 园豆:8
提问于:2016-01-12 16:40
< >
分享
所有回答(2)
0

更新gcc版本才行吧,mariadb新版本使用了C++11的新特性了

2012 | 园豆:21645 (高人七级) | 2016-01-13 09:57
0

你的编译器不支持 -std=c++11 或 -std=c++0x

看编译器的版本输出信息,这个编译器是你自己编译的吧?一般发行版打包的gcc参数不会这么少。

如果使用的是archlinux,使用pacman按照gcc。输出版本信息中,配置信息应该是很长的。

配置为:../configure --prefix=/usr --disable-multilib --enable-languages=c,c++,java

乌合之众 | 园豆:260 (菜鸟二级) | 2016-05-04 10:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册