Warning C4251 using STL container member in class in DLL
Posted: Thu Jun 22, 2006 5:00 pm
I'm trying to export a class for a dll that has a std::list member variable, but the compiler gives me this warning:
The code looks like this:
I've looked through Ogre's code and though I can see that Ogre is successfully doing this, I can't figure out how.
Any help would be much appreciated.
Edit:
Here's the typdef for EventList
Code: Select all
(32) : warning C4251: 'IEventReceiver::mPendingEvents' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'IEventReceiver'
Code: Select all
class EGExport IEventReceiver
{
public:
IEventReceiver();
virtual ~IEventReceiver();
private:
IEventReceiver( IEventReceiver const& );
public:
void receiveEvent( IEvent *event );
virtual void handleEvent( IEvent *event ) = 0;
void handleAllEvents();
virtual void subscribeToEvents() = 0;
void unsubscribeFromAllEvents();
private:
// compiler is complaining about the line below
EventList mPendingEvents;
};
Any help would be much appreciated.
Edit:
Here's the typdef for EventList
Code: Select all
typedef std::list<IEvent*> EventList;