今天编译安装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
确实没法了,求助求助
更新gcc版本才行吧,mariadb新版本使用了C++11的新特性了
你的编译器不支持 -std=c++11 或 -std=c++0x
看编译器的版本输出信息,这个编译器是你自己编译的吧?一般发行版打包的gcc参数不会这么少。
如果使用的是archlinux,使用pacman按照gcc。输出版本信息中,配置信息应该是很长的。
配置为:../configure --prefix=/usr --disable-multilib --enable-languages=c,c++,java