簡體   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' 我正在使用 dlib 庫運行練習代碼。 它一直運行到'cmake',但在'make'過程中出現上述錯誤。 需要更新 gcc?

gcc 版本如下所示。 gcc (GCC) 4.8.5 20150623 (紅帽 4.8.5-39)

如果您需要更新我想知道的版本,該怎么做。

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

GCC 開發人員非常好,但在 C++17 完成前兩年支持 C++17 的出貨量非常好。

不過,對於某些 C++17 功能,該編譯器可能支持-std=c++1z

正如其他人提到的,您的編譯器對於 C++17 來說太舊了。

聽起來您使用的是 RHEL 7 或 CentOS 7。這些操作系統支持使用較新版本的編譯器和工具鏈(除了標准系統編譯器)安裝“開發工具集”。 這可能是您的一個選擇。

對於 RHEL 7,請參閱: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/10/

對於 CentOS,請參見:https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM