Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/144.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse:如何启用编译选项,在C++;,OpenCL程序 当我用Eclipse IDE为C/C++开发版本构建C++程序OpenCL时,我得到了这个错误:Luna Service Relp 2(4.4.2):_C++_Eclipse_Build_Compiler Errors_Opencl - Fatal编程技术网

Eclipse:如何启用编译选项,在C++;,OpenCL程序 当我用Eclipse IDE为C/C++开发版本构建C++程序OpenCL时,我得到了这个错误:Luna Service Relp 2(4.4.2):

Eclipse:如何启用编译选项,在C++;,OpenCL程序 当我用Eclipse IDE为C/C++开发版本构建C++程序OpenCL时,我得到了这个错误:Luna Service Relp 2(4.4.2):,c++,eclipse,build,compiler-errors,opencl,C++,Eclipse,Build,Compiler Errors,Opencl,我可以通过终端($g++…)成功地编译它 如何解决此问题?在project Explorer->Properties->C/C++Build->Settings中右键单击您的项目 在工具设置选项卡中,有一个GCC C++编译器项目。展开它并选择设置->混合 在其他标志文本的末尾追加字符串-std=c++11 这应该针对您需要的任何配置进行。将-opencl添加到标志中。Project Explorer->Properties->C/C++Build->您正在使用的编译器->miscellaneo

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


如何解决此问题?

在project Explorer->Properties->C/C++Build->Settings中右键单击您的项目

在工具设置选项卡中,有一个GCC C++编译器项目。展开它并选择设置->混合

在其他标志文本的末尾追加字符串
-std=c++11


这应该针对您需要的任何配置进行。

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

非常感谢@Paolo M,但是在我这样做之后,我得到了很多关于OpenCL指令的错误(25个错误),比如:Description Resource Path Location Type undefined reference to`clCreateBuffer'SNM.cpp/SNM/src line 176 C/C++问题
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