我正在尝试在 mingw32 中使用以下命令编译我的 OpenCL 应用程序:mingw32-gcc -o plat plat.c
但我收到此错误:CL/cl.h 没有这样的文件或目录
我在网上和这个网站上搜索了很多次,但找不到任何好的答案。我做了所有的工作,但它仍然出错。我使用 AMD Radeon HD 5470 并在 win 7 上安装了最新的催化剂驱动程序和 AMD APP SDK 2.8 我安装了 VS 2012
在我的代码中,我使用了几个希望工作的状态,但是....它仍然会犯同样的错误
我还在编译命令中使用了 -I & -L ,它仍然会出错:CL/cl.h no such file or directory
我怎么不知道如何使用make 文件来编译代码
我会非常感谢任何帮助我的人:mehdioraki59@yahoo.com
我的系统是:dell studio 1558
这是我非常非常简单的测试代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#ifdef MAC
#include <OpenCL/cl.h>
#else
#include <C:\Program Files (x86)\AMD APP\include\CL\cl.hpp>
//#include <CL/cl.h> >>>>>>> i manually disabled this line but there is still error
#endif
int main() {
cl_platform_id *platforms;
cl_uint num_platforms;
cl_int i, err, platform_index = -1;
char* ext_data;
size_t ext_size;
err = clGetPlatformIDs(1, NULL, &num_platforms);
if(err < 0) {
perror("Couldn't find any platforms.");
exit(1);
}
free(platforms);
return 0;
}