I\'m trying to make my library exportable as a DLL but I\'m getting a lot of these warnings for one specific class that uses std::vector:
template
One fix is relying on dynamic allocation/deallocation of the STL structures. So:
class EXPORTED ExportedClass
{
private:
std::vector *_integers;
public:
ExportedClass()
{
_integers = new std::vector();
}
~ExportedClass()
{
delete _integers;
}
};
won't give any warning and it's more safe in case you are distributing the same binary (the dll) that has to be used with different version of the compiler that may has different versions of the STL. In this way you have 100% guarantee that sizeof(ExportedClass)
is always the same.