Search code examples
visual-studio-2010shared-librariesstatic-librariesdllexportdeclspec

Symbol not exported in DLL


I'm generating a DLL within VS2010 in two steps:

First a static .LIB file is generated where a function is defined as __declspec(dllexport). Second a DLL is generated that links against that .LIB file. This resulting DLL does not contain the exported function out of the .LIB.

Any ideas what could cause this?

I also tried to add an option /EXPORT:funcname to the libraries project settings. And I checked the generate .LIB file itself, there the function is not exportet (but I'm not 100% sure regarding the tool I use for checking the libraries exports...)

Thanks!


Solution

  • I think I got it: The /EXPORT:funcname option has to be added to the DLL project too - elsewhere the linker does not know this symbol out of the static lib has to be exported.