Is there an appropriate equivalent for building dlls with Visual Studio?

In a DLL (linked at runtime) I need to call functions statically linked in my application.

I did this on the Linux side by associating the application with the -rdynamic gcc parameter, but with Visual Studio I can’t find a way to export all non-static symbols to dynamic libraries and link DLLs without an unresolved symbol .

  • I really do not want to convert my entire application into several DLLs and add convenient macros for the correct processing of _declspec(dllimport) / _declspec(dllexport) .
  • I also do not want to pass all my APIs to DLLs using function pointers.

Is there a better way around this problem?

+4
source share
1 answer

You can use the script to analyze the source code and automatically generate the .DEF file. It can be even easier if you want to export only those functions that were declared in the header files.

Another solution is to compile the code into a static .lib and use dumpbin / SYMBOLS to create a list of all characters. You can use this list to generate .DEF for the DLL version. This approach may be nice if you are creating a static and dynamic library from the same project. The DLL will simply be the initialization of the DLL, the finalization functions + .DEF file and the declaration that it uses your static .lib.

0
source

All Articles