【发布时间】:2017-12-12 12:08:07
【问题描述】:
我尝试使用 opendavinci 为 torcs 编译一个机器人。问题是每次我尝试编译它时
#error This file requires compiler and library support for the ISO C++ 2011 standard
出现。显而易见的解决方案是添加支持,但我有一个来自 torcs 的复杂 makefile,所以我不知道如何解决这个问题。
有什么方法可以在不更改 makefile 的情况下添加支持?我读过 CXXFLAGS 可以帮助我,但我不明白它是如何工作的。
编译器是g++ 5.4.0 for Ubuntu
felix@ubuntufelix:/usr/src/torcs/torcs-1.3.7/src/drivers/bt$ make
g++ -I/usr/src/torcs/torcs-1.3.7/export/include -I/usr/src/torcs/torcs-1.3.7 -g -O2 -Wall -fPIC -fno-strict-aliasing -O2 -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -Wall -fPIC -fno-strict-aliasing -O2 -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DHAVE_CONFIG_H -c driver.cpp
In file included from /usr/include/c++/5/array:35:0,
from driver.h:15,
from driver.cpp:1:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
【问题讨论】:
-
什么编译器??
-
进行了编辑,它是 g++ 5.4.0
-
“有没有什么方法可以在不改变 makefile 的情况下添加支持?” 那么,构建系统的其余部分是什么?如果它使用 Autoconf 或 Meson 之类的东西,那么您可以传递自定义编译器/预处理器/等。通过那个争论。您仍然需要添加更多信息。
-
你可以试试
CXXFLAGS="-std=c++11" make -
这是一个构建问题。向我们展示您如何构建二进制文件,我们可能会告诉您如何正确完成。
标签: c++ makefile compiler-errors