centos编译 mesos出错
In file included from /usr/include/limits.h:26:0, from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/limits.h:168, from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/syslimits.h:7, from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/limits.h:34, from /usr/include/python2.7/Python.h:19, from src/mesos/executor/mesos_executor_driver_impl.cpp:19: /usr/include/features.h:330:4: 警告:#warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] # warning _FORTIFY_SOURCE requires compiling with optimization (-O) ^ In file included from /usr/include/c++/4.8.2/mutex:35:0, from /root/mesos/build/../include/mesos/executor.hpp:20, from src/mesos/executor/mesos_executor_driver_impl.hpp:20, from src/mesos/executor/mesos_executor_driver_impl.cpp:24: /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: 错误:#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the \ ^ In file included from src/mesos/executor/mesos_executor_driver_impl.hpp:20:0, from src/mesos/executor/mesos_executor_driver_impl.cpp:24: /root/mesos/build/../include/mesos/executor.hpp:242:3: 错误:‘recursive_mutex’不是命名空间‘std’中的一个类型名 std::recursive_mutex mutex; ^ error: command 'gcc' failed with exit status 1
看makefile文件,明明有这个参数
CPP = gcc -E -std=gnu++11
但gcc没有。
CC = gcc
把cc加上 改为
CC = gcc -std=gnu++11
再编译
还是同样的错
看编译命令行
gcc -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -g1 -O0 -Wno-unused-local-typedefs -g1 -O0 -Wno-unused-local-typedefs -I/usr/include/subversion-1 -I/usr/include/apr-1 -I/usr/include/apr-1.0 -fPIC -I/root/mesos/build/../include -I/root/mesos/build/include -I/root/mesos/build/include/mesos -I/root/mesos/build/src -I/root/mesos/build/src/python/executor/src/mesos/executor -I/root/mesos/build/src/python/native_common -I/root/mesos/build/3rdparty/libprocess/3rdparty/protobuf-2.5.0/src -I/usr/include/python2.7 -c src/mesos/executor/mesos_executor_driver_impl.cpp -o build/temp.linux-x86_64-2.7/src/mesos/executor/mesos_executor_driver_impl.o
gcc还是没有参数
明明改了,却未生效
那就是改错了
找子目录src
又找到一个Makefile文件
两个内容一样
用同样的办法,改src/Makefile
编译,生效,通过

浙公网安备 33010602011771号