clGetPlatformIDs returns 4294967266, not expected

I was expecting some kind of error code, like the ones in this file: http://www.khronos.org/registry/cl/api/1.0/cl.h

I should get 0 right? This would be a CL_SUCCESS. All the other error codes appear to be negative. Since I got a positive number, is that also a CL_SUCCESS?

Just in case anyone is curious, here is my code below:

// Obtain the platform IDs and initialize the context properties
cl_uint error; //reusable variable for determining if an OpenCL function returns successfully or not

cl_platform_id *platforms;
cl_uint *num_platforms;

error = clGetPlatformIDs(1, platforms, num_platforms);
cout << error << endl;
return 0;

Error codes are signed integers. You have declared variable “error” as an unsigned integer.

FWIW, the number you gave us translates into -30 when interpreted as a signed integer, which corresponds to CL_INVALID_VALUE.

In addition to that your code is incorrect. You should be doing something like this:

// Obtain the platform IDs and initialize the context properties
cl_int error; //reusable variable for determining if an OpenCL function returns successfully or not

cl_platform_id platforms;
cl_uint num_platforms;

error = clGetPlatformIDs(1, &platforms, &num_platforms);
cout << error << endl;
return 0;

I would recommend refreshing your C skills for a while before attempting to tackle OpenCL.