c ++:错误:无法识别的命令行选项'-std = gnu ++ 14'

时间:2016-10-05 10:08:01

标签: c++ compiler-errors

我尝试构建fblualib。但是,运行build.sh时出现以下错误:

-- Found Folly: /usr/local/include  
-- Found Torch7 in /home/dmus/torch/install
-- Found Folly: /usr/local/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dmus/fblualib/fblualib/build
[ 25%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
c++: error: unrecognized command line option ‘-std=gnu++14’
make[2]: *** [CMakeFiles/fblualib.dir/LuaUtils.cpp.o] Error 1
make[1]: *** [CMakeFiles/fblualib.dir/all] Error 2
make: *** [all] Error 2

g ++ --version输出g ++(Ubuntu 4.8.4-2ubuntu1~14.04.1)4.8.4。我看到了相关的问题,但是我没有看到如何解决这个问题。

1 个答案:

答案 0 :(得分:3)

您需要升级g ++(至少升级到版本4.9。*)。

升级完成后,请尝试使用g++ -std=c++14 file.cppg++ -std=c++1y file.cpp进行编译。