"* has not been declared" when including cl.hpp

Even the simplest program (i.e. hello world) will not compile if I try to include “cl.hpp”.
I get a bunch of errors:


[toffyrn@bohr Test]$ g++ cltest.cpp 
In file included from cltest.cpp:1:0:
/usr/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
/usr/include/CL/cl.hpp:1465:12: error: ‘::clUnloadCompiler’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2D::Image2D(const cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, void*, cl_int*)’:
/usr/include/CL/cl.hpp:2109:19: error: ‘::clCreateImage2D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2DGL::Image2DGL(const cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2154:19: error: ‘::clCreateFromGLTexture2D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3D::Image3D(const cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, size_t, size_t, void*, cl_int*)’:
/usr/include/CL/cl.hpp:2208:19: error: ‘::clCreateImage3D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3DGL::Image3DGL(const cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2254:19: error: ‘::clCreateFromGLTexture3D’ has not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueMarker(cl::Event*) const’:
/usr/include/CL/cl.hpp:3544:13: error: ‘::clEnqueueMarker’ has not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueWaitForEvents(const std::vector<cl::Event>&) const’:
/usr/include/CL/cl.hpp:3551:13: error: ‘::clEnqueueWaitForEvents’ has not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueBarrier() const’:
/usr/include/CL/cl.hpp:3666:13: error: ‘::clEnqueueBarrier’ has not been declared

If I include “cl.h” instead, it compiles. I see that the headers have recently been updatet to 1.2, except C++ wrapper which is still at 1.1. Are these incompatible?

Downgraded all headers to 1.1, everything is working fine…
I suppose we should await cl.hpp for 1.2 sometimes in near future?

Try adding -DCL_USE_DEPRECATED_OPENCL_1_1_APIS as a compiler option while keeping the 1.2 headers. This yields a friendly
warning: #warning CL_USE_DEPRECATED_OPENCL_1_1_APIS is defined. These APIs are unsupported and untested in OpenCL 1.2! [-Wcpp]
but at least things compile again.