Fri, 07/19/2002 - 03:41
Forums:
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
Fri, 07/19/2002 - 05:20
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.
Mon, 07/22/2002 - 07:10
Thank you, Stephane. That corrected the problem.
Mike