Re: [K3d-development] Using VC to build
Brought to you by:
barche
From: Timothy M. S. <ts...@k-...> - 2007-05-28 19:54:08
|
Paul Gregory wrote: > The alternative to __delcspec(dllexport) is to use a .def file > (http://msdn2.microsoft.com/en-us/library/d91k01sh(VS.80).aspx > <http://msdn2.microsoft.com/en-us/library/d91k01sh%28VS.80%29.aspx>), > however, the bottom line is the same, you have to explicitly identify > the symbols that are to be exported from the DLL. There is no, as far > as I am aware, way of mimicking the Linux behaviour of exporting all > symbols from a DLL. Not only that, but there are some more significant > concerns on Windows you'll likely hit, there can be no unresolved > external symbols in a DLL at the time of linking the DLL. Linux allows > you to have unresolved symbols at link time, much like linking a > static library, that will be resolved at load time, that cannot be the > case with Windows. Just a heads up. Generating a .def file with every symbol isn't too difficult, I did it for gtkmm several years ago - you can either use DUMPBIN and some string processing or write a simple (< 50 lines of code) executable to dump all the symbols from your binary into a .def file. That covers exporting, you just use the .def file to generate the DLL's .lib file. The problem is with the import for users of a DLL - I don't recall how it used to be done pre-declspec. Seems like it was as simple as linking with the DLL's .lib file !? Cheers, Tim |