编译报#error This file requires compiler and library support......

[error] This file requires compiler and library support for the
upcoming ISO C++ standard, C++0x. This support is currently
experimental, and must be enabled with the -std=c++0x or -std=gnu++0x
compiler options.


解决方法

  1. Tools-》Compiler Options-》General-》Add the following commands when calling the compiler下输入:
    -std=c++11
    因为我报错是11,而不是该问题的0x,根据报错提示就行。当然,也可以输入:
    -std=gnu++11

  2. 编译器选择的问题,使用Dev c++的话,就按下面步骤将编译器调整为支持c++11即可步骤如下:
    工具-》编译选项-》代码生成/优化-》代码生成-》语言标准(选ISO C++11或者GNU C++11)-》确定
    回复

你可能感兴趣的:(C,C++)