I removed the #include from .cl file, and kept .h file in clcreateProgramWithSource, but when I build it I got nothing,
before adding it I was getting errors that variables are not defined, here my code, can you see if I maid errors in it:
[codebox]const char* clSourcefile = “oclfind_obj.cl”;// source file
const char* cvincludefile = “cv.h”; //include file
// Program Setup
const char* strings[2];
size_t program_length;
const char* source_path = shrFindFilePath(clSourcefile, argv[0]);
char *source = oclLoadProgSource(source_path, "", &program_length);
shrCheckErrorEX(source != NULL, shrTRUE, pCleanup);
size_t include_length;
const char* include_path = shrFindFilePath(cvincludefile, argv[0]);
char *cvinclude = oclLoadProgSource(include_path, "", &include_length);
shrCheckErrorEX(cvinclude != NULL, shrTRUE, pCleanup);
strings[0] = source;
strings[1] = cvinclude;
size_t lenghts[2];
lenghts[0] = program_length;
lenghts[1] = include_length;
// create the program
cpProgram = clCreateProgramWithSource(cxGPUContext, 2,(const char **) &strings, (const size_t *) &lenghts, &ciErrNum);
shrCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup);
// build the program
ciErrNum = clBuildProgram(cpProgram, 0, NULL, NULL, NULL, NULL);
if (ciErrNum != CL_SUCCESS)
{[/codebox]
Thanks.