add header file using clCreateProgramWithSource

Hi,

I added a header file to my program using clCreateProgramWithSource,
because I had errors that the code doesn’t recognize variables defined in the .h file
this is my code:

const char* files[2];
size_t include_length;
const char* include_path = "C:/Users/localcontrol/Desktop/work/nvidia3.0/cv.h";
char *cvinclude = oclLoadProgSource(include_path, "", &include_length);
printf( "cv path %s
", include_path);
//printf( "%s
", cvinclude);
printf( "include_length %d
", include_length);
shrCheckErrorEX(cvinclude != NULL, shrTRUE, pCleanup);

size_t program_length;
const char* source_path = shrFindFilePath(clSourcefile, argv[0]);
char *source = oclLoadProgSource(source_path, "", &program_length);
printf( "cl path %s
", source_path);
//printf( "%s
", source);
printf( "program_length %d
", program_length);
shrCheckErrorEX(source != NULL, shrTRUE, pCleanup);

files[0] = cvinclude;
files[1] = source;
size_t lenghts[2];
lenghts[0] = include_length;
lenghts[1] = program_length;

printf( "%s
", files[0]);
printf( "%s
", files[1]);
// create the program
cpProgram = clCreateProgramWithSource(cxGPUContext, 2, (const char **) &files, (const size_t *) lenghts, &ciErrNum);
oclCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup);

// build the program
ciErrNum = clBuildProgram(cpProgram, 0, NULL, "-cl-mad-enable", NULL, NULL);

but it doesn,t build my program,
I get Error # 1 at file .c

can anyone see if I made mistakes in my code
Help please.

There have been several people reporting problems with Nvidia drivers and loading header files. Try pasting your header file code directly into the file you send to clCreateProgram and see if it works.