Hey all,
I have classes in my application, which inside themselves create pointers to other classes which came as part of a library (Irrlicht in this case). Now I am new to OOP but I am sure this is just an inheritence issue. I am getting errors like this:
../include/config.h:32: ISO C++ forbids initialization of member `device'
../include/config.h:32: making `device' static
../include/config.h:32: invalid in-class initialization of static data member
Which I assume leads to the errors like this:
"main.cpp:184: `class Config' has no member named 'device' "
^ Even though the class does have a member named device. Now in this case this is the class where device is initalized:
Code:
class Config {
public:
// Variables
IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(1800, 1100), 16, false, false, false, NULL);
ISceneManager* smgr = device->getSceneManager();
IVideoDriver* driver = device->getVideoDriver();
core::stringw HelpText;
video::E_DRIVER_TYPE driverType = EDT_OPENGL;
int header;
stringc str1, str2, str3, c1, c2, c3, c4;
int header_lines, format_cols, driverType_int;
// Functions
Config();
~Config();
void ReadXML(void);
void writeConfigFile();
void updatePref();
};
and this is how I call it in main.cpp: config.device->run()
Now device is a member of the Irrlicht library, have I forgotten to inherit this library properly?