简体   繁体   English

c++:错误:无法识别的命令行选项“-std=c++17”

[英]c++: error: unrecognized command line option ‘-std=c++17’

[ 25%] Building CXX object CMakeFiles/linreg-dlib.dir/linreg_dlib.cc.o
/usr/bin/c++   -I/home/jeong/다운로드/dlib-master -I"/home/jeong/바탕화면/9781789955330_Code/Chapter01/dlib_samples/path to dlib install dir/include"  -std=c++17 -msse3 -fopenmp -Wall -Wextra   -o CMakeFiles/linreg-dlib.dir/linreg_dlib.cc.o -c /home/jeong/바탕화면/9781789955330_Code/Chapter01/dlib_samples/linreg_dlib.cc
c++: error: unrecognized command line option ‘-std=c++17’
make[2]: *** [CMakeFiles/linreg-dlib.dir/linreg_dlib.cc.o] error 1
make[2]: Leaving directory `/home/jeong/바탕화면/9781789955330_Code/Chapter01/dlib_samples'
make[1]: *** [CMakeFiles/linreg-dlib.dir/all] error 2
make[1]: Leaving directory `/home/jeong/바탕화면/9781789955330_Code/Chapter01/dlib_samples'
make: *** [all] error 2

c++: error: unrecognized command line option '-std=c++17' I am running the practice code using the dlib library. c++: error: unrecognized command line option '-std=c++17' 我正在使用 dlib 库运行练习代码。 It runs until'cmake', but the above error appears during'make' process.它一直运行到'cmake',但在'make'过程中出现上述错误。 Need to update gcc?需要更新 gcc?

The gcc version is shown below. gcc 版本如下所示。 gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) gcc (GCC) 4.8.5 20150623 (红帽 4.8.5-39)

How to do it if you need to update the version I wonder.如果您需要更新我想知道的版本,该怎么做。

The GCC releases page ( https://www.gnu.org/software/gcc/releases.html ) says that gcc 4.8.5 was released on June 23, 2015. The GCC releases page ( https://www.gnu.org/software/gcc/releases.html ) says that gcc 4.8.5 was released on June 23, 2015.

The GCC developers are really good, but shipping C++17 support two years before C++17 was completed is beyond good. GCC 开发人员非常好,但在 C++17 完成前两年支持 C++17 的出货量非常好。

That compiler may support -std=c++1z for some C++17 features, though.不过,对于某些 C++17 功能,该编译器可能支持-std=c++1z

As others have mentioned your compiler is too old for C++17.正如其他人提到的,您的编译器对于 C++17 来说太旧了。

It sounds like you are on either RHEL 7 or CentOS 7. Those OSes support installation of "Developer Toolsets" with newer versions of the compiler and toolchain (in addition to the standard system compiler).听起来您使用的是 RHEL 7 或 CentOS 7。这些操作系统支持使用较新版本的编译器和工具链(除了标准系统编译器)安装“开发工具集”。 This might be an option for you.这可能是您的一个选择。

For RHEL 7 see: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/10/对于 RHEL 7,请参阅: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/10/

For CentOS see:https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/对于 CentOS,请参见:https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C++:错误:无法识别的命令行选项“-std=gnu++14” - c++: error: unrecognized command line option ‘-std=gnu++14’ C ++错误:无法识别的命令行选项“ -msse3” - c++ error:unrecognized command line option '-msse3' c++:错误:无法识别的命令行选项“-target” - c++: error: unrecognized command-line option ‘-target’ Netbeans 7.2中无法识别的命令行选项“ -std = c ++ 11” c ++ - Unrecognized command line option “-std=c++11” c++ in Netbeans 7.2 如何摆脱 g++ 命令行中的 -std=c++17 ? - how to get rid of -std=c++17 in g++ command line? 无法识别的命令行选项“-std = c ++ 11” - unrecognized command line option “-std=c++11” 无法识别的命令行选项'-std = c ++ 11' - unrecognized command line option '-std=c++11' cmake 错误:“cc:错误:无法识别的命令行选项 '-std=c++20';您的意思是 '-std=c++2a'?” - cmake error: "cc: error: unrecognized command line option ‘-std=c++20’; did you mean ‘-std=c++2a’?" 无法解析cc1plus:错误:无法识别的命令行选项“ -std = c ++ 11” - Failed to resolve cc1plus: error: unrecognized command line option “-std=c++11” cc1plus:错误:无法识别的命令行选项“-std=c++0x” - cc1plus: error: unrecognized command line option "-std=c++0x"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM