Is there any way to force visual studio to link all symbols from a lib file into the dll as atm it is optimizing \"unused\" functions which are needed by the program using t
I had the same problem with a plugin system where factories in various DLLs were using a common main factory, everything registering at startup when loading libraries, without having to hard compile the list of plugins to use. This was working very well under Linux but had two problems under Windows:
they were not setup at startup if no symbol of the DLL were used in the main. I think it is your problem. The only solution I found were to use configuration files (one by subproject) listing the names of the plugins (DLLs) available and force their linking using, in my case, QLibrary. Using cmake, a default version of a configuration file for each subproject is generated at build time using the following macro, called instead of add_library in each plugin dir:
file(WRITE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-plugins "")
macro (DECLARE_AMOSE_PLUGIN _plugin)
file (APPEND ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-plugins "${_plugin}\n")
add_library(${_plugin} SHARED ${${_plugin}_LIB_SRCS})
endmacro (DECLARE_AMOSE_PLUGIN)