Results 1 to 3 of 3

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

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    2

    "* 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:
    Code :
    [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?

  2. #2
    Junior Member
    Join Date
    Dec 2011
    Posts
    2

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

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

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    1

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

    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.

Similar Threads

  1. "vgSetParameterfv" vs "vgSetColor"
    By gthm159 in forum OpenVG and VGU
    Replies: 1
    Last Post: 08-15-2008, 02:28 AM
  2. "required extension" and "core addition"
    By wycwang in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 09-19-2007, 02:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •