Khronos Public Bugzilla
Bug 316 - C++ bindings rev 48 NO_STD_VECTOR issue
C++ bindings rev 48 NO_STD_VECTOR issue
Status: RESOLVED FIXED
Product: OpenCL
Classification: Unclassified
Component: Header Files
1.0
PC Linux
: P3 major
: ---
Assigned To: Benedict Gaster
OpenCL Working Group
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-10 17:54 PDT by Jason Grimes
Modified: 2013-10-31 03:01 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Grimes 2010-06-10 17:54:09 PDT
I was testing some code that I wrote and needed to have a second test to confirm the error I was getting so I used the hello world code that is in the include file.  It would not compile with g++ version 4.3.2 and the compiler gave the following errors:

g++ hello.cpp -o test2 -I /usr/include/CL -lOpenCL -Wall
In file included from hello.cpp:9:
/usr/include/CL/cl.hpp:3798: error: ‘pair’ is not a member of ‘cl::std’
/usr/include/CL/cl.hpp:3798: error: ‘pair’ is not a member of ‘cl::std’
/usr/include/CL/cl.hpp:3798: error: template argument 1 is invalid
/usr/include/CL/cl.hpp:3798: error: expected unqualified-id before ‘>’ token
/usr/include/CL/cl.hpp:3799: error: ‘pair’ is not a member of ‘cl::std’
/usr/include/CL/cl.hpp:3799: error: ‘pair’ is not a member of ‘cl::std’
/usr/include/CL/cl.hpp:3799: error: template argument 1 is invalid
/usr/include/CL/cl.hpp:3799: error: expected unqualified-id before ‘>’ token
/usr/include/CL/cl.hpp:3824: error: expected ‘,’ or ‘...’ before ‘&’ token
/usr/include/CL/cl.hpp:3904: error: expected ‘,’ or ‘...’ before ‘&’ token
/usr/include/CL/cl.hpp: In constructor ‘cl::Program::Program(const cl::Context&, int)’:
/usr/include/CL/cl.hpp:3829: error: ‘sources’ was not declared in this scope
/usr/include/CL/cl.hpp:3842: error: ‘err’ was not declared in this scope
/usr/include/CL/cl.hpp: In constructor ‘cl::Program::Program(const cl::Context&, const cl::vector<cl::Device, 10u>&, int)’:
/usr/include/CL/cl.hpp:3909: error: ‘binaries’ was not declared in this scope
/usr/include/CL/cl.hpp:3921: error: ‘binaryStatus’ was not declared in this scope
/usr/include/CL/cl.hpp:3926: error: ‘err’ was not declared in this scope
/usr/include/CL/cl.hpp: At global scope:
/usr/include/CL/cl.hpp:5879: error: ‘cl::std::pair’ has not been declared
/usr/include/CL/cl.hpp:5879: error: expected ‘,’ or ‘...’ before ‘<’ token
/usr/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueNativeKernel(void (*)(void*), int) const’:
/usr/include/CL/cl.hpp:5887: error: ‘args’ was not declared in this scope
/usr/include/CL/cl.hpp:5888: error: ‘mem_objects’ was not declared in this scope
/usr/include/CL/cl.hpp:5890: error: ‘mem_locs’ was not declared in this scope
/usr/include/CL/cl.hpp:5891: error: ‘events’ was not declared in this scope
/usr/include/CL/cl.hpp:5893: error: ‘event’ was not declared in this scope
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ext/new_allocator.h:37,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/x86_64-redhat-linux/bits/c++allocator.h:39,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/allocator.h:53,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/string:48,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/locale_classes.h:47,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/ios_base.h:48,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ios:48,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ostream:45,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/iostream:45,
                 from hello.cpp:13:
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/new: At global scope:
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/new:59: error: expected class-name before ‘{’ token
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ios:48,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ostream:45,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/iostream:45,
                 from hello.cpp:13:
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/ios_base.h:210: error: expected class-name before ‘{’ token
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/iostream:45,
                 from hello.cpp:13:
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ostream: In destructor ‘std::basic_ostream<_CharT, _Traits>::sentry::~sentry()’:
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ostream:415: error: there are no arguments to ‘uncaught_exception’ that depend on a template parameter, so a declaration of ‘uncaught_exception’ must be available
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ostream:415: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
hello.cpp: In function ‘int main()’:
hello.cpp:30: error: ‘Sources’ is not a member of ‘cl::Program’
hello.cpp:30: error: expected `;' before ‘source’
hello.cpp:32: error: ‘source’ was not declared in this scope

I changed the code by removing the #define __NO_STD_VECTOR and changing the cl::make_pair line to std::make_pair.  The code then was able to compile and I was able to run it.  It looks like there are domain issues with the cl vector code.  

Jason
Comment 1 Bruce Merry 2013-10-31 03:01:02 PDT
I've fixed this in the Khronos-internal version. It should work once a new cl.hpp release is made.