Eclipse:如何启用编译选项,在 C++ 中构建错误,OpenCL 程序

Eclipse: how to enable compile options, build error in C++, OpenCL program

当我通过 Eclipse IDE 为 C/C++ 开发人员版本:Luna Service Release 2 (4.4.2) 构建 C++、OpenCl 程序时出现此错误:

Description Resource    Path    Location    Type
#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. SNM     line 32, external location: /usr/include/c++/4.8/bits/c++0x_warning.h   C/C++ Problem

我可以通过终端编译成功($g++...)

我该如何解决这个问题?

Project Explorer 上右键单击您的项目 -> Properties -> C/C++构建 -> 设置.

工具设置选项卡中,有一个GCC C++编译器项。展开它并select 设置 -> 杂项

Other Flags 文本的末尾追加输入字符串 -std=c++11

这应该针对您需要的任何配置完成。

将 -opencl 添加到标志中。 Project Explorer -> Properties -> C/C++ Build -> 您正在使用的编译器 -> 杂项。