Hi, I’ve run into an issue which appears to suggest that nvcc is not treating nested C++ classes correctly, and would be grateful for any help with the issue. The problem comes from a header file from the jsoncpp package, the file being json/value.h. The error is:
---
/usr/include/jsoncpp/json/value.h: At global scope:
/usr/include/jsoncpp/json/value.h:164:16: error: ‘class Json::Value::CZString’ is private
class CZString
^
/usr/include/jsoncpp/json/value.h:998:49: error: within this context
explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t );
---
That file has a class declaration of (unnecessary detail redacted):
class JSON_API Value
{
public:
typedef ValueConstIterator const_iterator;
...
private:
class CZString
{
...
};
};
By changing that “private” declaration to “public” I can make the error message go away, but I shouldn’t have to as there’s nothing wrong with that code. g++ (v 4.8) has no problem with it, and I’m not keen on changing that access level just to placate nvcc, especially as it’s a system header file. I’m using CUDA 7.5 with C++11 extensions under Ubuntu 14.04.3. Any help would be much appreciated.