我今天在服务器上的家目录中编译了
在CMakeLists.txt文件中:
在CMakeFiles/a.out.dir/flags.make中。
gcc
和cmake
(按此顺序),因为服务器上的编译器已经有5年历史,我需要使用C++14
特性。当我通过命令编译时没有任何问题。请注意,保留HTML标记。g++ -std=c++14 main.cc
但是如果我使用cmake .
然后make
,我会得到以下错误:
cc1plus: error: unrecognized command line option "-std=c++14"
在CMakeLists.txt文件中:
add_definitions(-std=c++14)
在CMakeFiles/a.out.dir/flags.make中。
CXX_FLAGS = -I/home/jager/manufacture/usr/local/include -std=c++14
有关信息:
$ g++ --version
g++ (GCC) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cmake --version
cmake version 3.3.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
我不知道这是什么鬼...