在SSH Secure Shell c++中编译

compiling in SSH Secure Shell c++

本文关键字:编译 c++ Shell SSH Secure      更新时间:2023-10-16

当我运行g++时,它抛出了几个错误:

$ g++  SongStructure.cpp mtmtest.cpp Song.cpp examples/OldSongExample.cpp -std=c++11 -Wall -Werror -pedantic-errors -DNDEBUG -o example
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-std=c++11"

如何解决这个问题,为什么会发生这种情况?有人知道吗?

您的g++ (gcc)版本不支持c++ 11标准。您可以不使用c++ 11(或者如果不使用,则不要指定-std=c++11),尝试使用旧版本的GCC支持的-std=c++0x,当c++ 11是实验性的并被命名为c++ 0x时,或者升级您的编译器。