c++: error: unrecognized command line option ‘-std=c++14’

一世执手 提交于 2020-02-22 08:31:06

问题


I just moved my PC from Ubuntu 15.10 to Linux Mint 17.3.

Before this shift, this project compiled just fine in CLion. Now, it gives the following error:

c++: error: unrecognized command line option ‘-std=c++14’

This is probably due to this line in my CMake file:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -W -Wall -Wextra -pedantic")

I suspect this error is due to some outdated library/compiler. I don't know exactly what I need to do.

P.S.: I know that C++14 is not completely supported in CLion, and the editor will complain about syntax errors, but it will compile fine nonetheless.


回答1:


-std=c++14 is called -std=c++1y in old gcc versions (at least 4.9 and older).



来源:https://stackoverflow.com/questions/36245428/c-error-unrecognized-command-line-option-std-c14

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!