Page 1 of 1

ISceneUserDataSerializer is a struct? (apparently)

Posted: Sat Nov 11, 2006 6:21 pm
by Paradigm^
Hello (again).

I found I had exactly the same problem as mentioned in this thread and with a bit of searching and clarifying I now know what I should be doing. Having come to compile time, I get a very odd error though:

Code: Select all

In file included from engine.cpp:3:
mapserialiser.h:9: error: invalid use of undefined type `struct irr::scene::ISceneUserDataSerializer'
../irrlicht-1.1/include/ISceneManager.h:111: error: forward declaration of `struct irr::scene::ISceneUserDataSerializer'
As far as the documentation, the source code, and I know, ISceneUserDataSerializer is definitely not a struct. It's an interface. All I've tried to do is implement this, but it's not happy, and I don't know why. Here's my .h file:

Code: Select all

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

class MapSerialiser : public ISceneUserDataSerializer{
public:
	MapSerialiser(ISceneManager*, IMetaTriangleSelector*, IMetaTriangleSelector*);
	virtual IAttributes* createUserData(ISceneNode*);
	virtual void OnReadUserData(ISceneNode*, IAttributes*);

private:
	ISceneManager* sm;
	IMetaTriangleSelector* mp;
	IMetaTriangleSelector* mpp;
};
Is something wrong with it, or is the problem elsewhere? Thought I'd put this question here rather than in the other thread because I have a feeling it's a programming error rather than something serious.

Cheers!

Posted: Sat Nov 11, 2006 6:38 pm
by vitek
It looks like you need to include ISceneUserDataSerializer.h. Your header shows no includes, but at the very least it should have the following near the top...

Code: Select all

#include <Irrlicht.h>

// need to include this explicitly because someone forgot to put it in the global header Irrlicht.h
#include <ISceneUserDataSerializer.h>

Posted: Sat Nov 11, 2006 6:43 pm
by Paradigm^
Aha! Thanks. All my #includes are in the .cpp files, which is why you don't see them in the .h file. Adding a #include for ISceneUserDataSerializer fixed it. Well done to whoever it is that forgot to add it in irrlicht.h, it's had me confused for the past two hours :p

Cheers!