[cmake-developers] MSVC dll define global variables as well as functions?

Bill Hoffman bill.hoffman at kitware.com
Fri Nov 13 14:37:53 EST 2015


On 11/13/2015 2:14 PM, Richard Thiebaud via cmake-developers wrote:
> When building a DLL with MSVC, CMAKE 3.4 can now auto-create a .def file
> for all functions in the DLL, but global variables or static class
> variables are not included in the .def file. Could the .def file be
> created with def's for the variables as well as the functions?
See my blog on the topic:
http://www.kitware.com/blog/home/post/939

Short answer is no, it is not possible.  The def file has all of that 
stuff.  The problem is the calling code needs to know.  That is stuff 
linking to the dll needs to know at compile time if the global variable 
is in a dll or not.

-Bill



More information about the cmake-developers mailing list