Compile c++14-code with g++

前端 未结 4 1357
执笔经年
执笔经年 2020-12-02 16:35

I\'m using g++ 4.8.4 on Ubuntu 14.04 LTS. When trying to compile with \'-std=c++14\', I get this error:

g++: error unrecognized command line option \'-std=c+         


        
4条回答
  •  日久生厌
    2020-12-02 17:19

    G++ does support C++14 both via -std=c++14 and -std=c++1y. The latter was the common name for the standard before it was known in which year it would be released. In older versions (including yours) only the latter is accepted as the release year wasn't known yet when those versions were released.

    I used "sudo apt-get install g++" which should automatically retrieve the latest version, is that correct?

    It installs the latest version available in the Ubuntu repositories, not the latest version that exists.

    The latest GCC version is 5.2.

提交回复
热议问题