I have a makefile project that builds and links a DLL, using the command-line cl.exe compiler, which is included in the VC++ Express (free) tool. I now want to convert that makefile project into a Visual Studio project.
The DLL is not actually C++; it’s all written in C.
The DLL exports a small number of symbols, functions that are called by other programs that link to the DLL. I believe that in order to produce this DLL, I need to include an /EXPORT:Foo statement on the link command line, for each exported symbol.
How do I do the same in Visual Studio 2008? How do I specify the linker options to export a specific, small set of functions from the DLL?
You will have to use the “Additional Options” in the linker “Command Line” property and add the options explicitly.
I think that most people use the
__declspec(dllexport)attributes along with macros to make it more usable and to make the declspec a dllimport version in the headers for clients of the library.