I am trying to build a DLL. There are tons of new datatype and class are
defined in the code. I wonder if there is an easy way to setup the .def file
so that I can buid the dll and .lib? or is there a alternate way to avoid
manully defining all the exports?
Another questions is how can I export the template class? for example, if I
have some like, template <int W> class sc_int; , defined in the DLL, what is
the right way to put it in the .def file so that an application can use any
sc_int<x>?
Thanks a lot,
May
David Lowndes - 10 Sep 2005 10:03 GMT
>I am trying to build a DLL. There are tons of new datatype and class are
>defined in the code. I wonder if there is an easy way to setup the .def file
>so that I can buid the dll and .lib? or is there a alternate way to avoid
>manully defining all the exports?
Use __declspec(dllexport). For an overview, see the topic titled
"Exporting from a DLL" in MSDN.
>Another questions is how can I export the template class?
See if MSDN topic "How To Exporting STL Components Inside & Outside of
a Class" is any help.
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq