Exporting class that has TopoDS_Solid member

Hello,
I'm working in Windows NT, and I've created a class, myClass, that contains a TopoDS_Solid datamember. If I try to export 'myClass' to another DLL, I get this warning:

warning C4251: 'm_solid' : class 'TopoDS_Solid' needs to have dll-interface to be used by clients of class 'myClass'

Sample code:
#ifdef MYDLL_EXPORTS
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP __declspec(dllimport)
#endif

class DLLIMPEXP myClass
{
public:
myClass();
virtual ~myClass();

private:
TopoDS_Solid m_solid;
};

How can I export this class into another DLL without receiving the warning?

Thank you,
Mike

Stephane Routelous's picture

Hi,

you have to export all the function of the class, and not the class itself.
Open an header file from OpenCASCADE, and you will see the Standad_EXPORT macro at the beginning of all method declaration.

mriley's picture

Thank you, Stephane. That corrected the problem.

Mike