clBuildProgram failed


I have worked little bit in OpenCL now but recently “clBuildProgram” failed in one of my program. My code excerpt is below:

cl_program program;
program = clCreateProgramWithSource(context, 1, (const char**) &kernel_string, NULL, &err);
if(err != CL_SUCCESS)
cout<<"Unable to create Program Object. Error code = "<<err<<endl;
if(clBuildProgram(program, 0, NULL, NULL, NULL, NULL) != CL_SUCCESS)
cout<<"Program Build failed
size_t length;
char buffer[2048];
clGetProgramBuildInfo(program, device_id[0], CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &length);
cout<<”— Build log —

Normally earlier I got syntax or other errors inside kernel file here with the help of “clGetProgramBuildInfo()” function whenever “clBuildProgram” Failed but when this program runs, on console it only prints:

Program Build failed
— Build log —
<Nothing here>

What can be the problem with my kernel file that I dont get any build fail information ?

And when I tried to print the error code returned by “clBuildProgram”; it is “-11”…