【发布时间】:2013-06-16 16:26:52
【问题描述】:
我正在尝试使用 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 file 来编译代码
我会非常感谢任何帮助我的人: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;
}
【问题讨论】:
-
非常感谢。我做的 。但它仍然会犯同样的错误