c++ - 在 SSH Secure Shell c++ 中编译

标签 c++ shell ssh compiler-errors g++

当我运行 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"

如何解决这个问题,为什么会这样?有人有想法吗?

最佳答案

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

关于c++ - 在 SSH Secure Shell c++ 中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14410596/

相关文章:

tomcat - 如何在 docker tomcat 容器中更新 war 文件

mysql - 使用工作台通过 ssh 连接到远程 MySQL 数据库

c++ - 检测图像中的区域。 QT 中的重叠小部件可能吗?

linux - 如何在Docker文件中包含Shell脚本套件

linux - 使用 shell 脚本替换文件中的行

shell - 如何在 zsh 中执行脚本然后变得可交互?

Java exec 或运行时无法与 ssh 一起使用

c++ - 指向成员函数的指针的问题

c++ - 我有一个引用,想调用一个采用 boost::shared_ptr 的函数

c++ - 在基于范围的 for 循环中报告奇怪的语法错误