Boost logo

Boost Users :

Subject: [Boost-users] [interprocess] warning C4251: need dll-interface
From: Brent Arias (Brent.Arias_at_[hidden])
Date: 2009-04-08 18:28:13


I've defined a class to use within shared memory, and I've decorated it with a Windows _declspec(export) to expose it from a DLL. When I compiled with VC 2008, I got this warning:

Warning C4251: class 'boost::interprocess::vector<T,A>' needs to have dll-interface to be used by clients of 'MyClass'

I searched boost user archives for any discussion of this, and in the context of boost.signals I've seen someone comment to simply disable the warning with:

#pragma warning (disable: 4251)
Std::list<OtherClass*> talkers;
#pragma warning (default: 4151)

Does this also apply to boost.interprocess? Is it really safe to ignore this warning and continue to use the interprocess code from within a DLL?

Brent Arias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net