Exporting DLL C++ Class , question about .def file

Vhaerun picture Vhaerun · Oct 9, 2008 · Viewed 12.9k times · Source

I want to use implicit linking in my project , and nmake really wants a .def file . The problem is , that this is a class , and I don't know what to write in the exports section . Could anyone point me in the right direction ?

The error message is the following :

NMAKE : U1073: don't know how to make 'DLLCLASS.def'

P.S: I'm trying to build using Windows CE Platform Builder .

Answer

Greg Hewgill picture Greg Hewgill · Oct 9, 2008

If I recall correctly, you can use __declspec(dllexport) on the class, and VC++ will automatically create exports for all the symbols related to the class (constructors/destructor, methods, vtable, typeinfo, etc).

Microsoft has more information on this here.