Here is my code DeviceClass.cpp:
...
#include "myHeader.h"
class DeviceClass : public DeviceClassBase {
private:
myClass::myStruct Foo;
Foo.one = 1;
Foo.two = 2;
myClass myclass(Foo);
...
};
This is myClass from the myHeader.h file:
class myClass : baseClass{
public:
struct myStruct {
myStruct():
one(0),
two(0){}
int one;
int two;
};
myClass(const myStruct &mystruct);
};
But this is failing to compile. I get this error:
: error: ISO C++ forbids declaration of 'myStruct' with no type
: error: expected ';' before '.' token
: error: 'myStruct' is not a type
: In member function 'virtual void DeviceClass::Init()':
: error: '((DeviceClass*)this)->DeviceClass::myclass' does not have class type
Where a m I going wrong?
I can only edit the DeviceClass.cpp file.