force visual studio to link all symbols in a lib file

后端 未结 6 1570
清酒与你
清酒与你 2020-12-09 16:19

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

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 16:48

    How is the DLL going to call the functions from your lib at runtime? That sounds a bit hard to believe.

    Now if users of the DLL are going to call your library functions, your question makes sense. Windows compilers (unlike Unix compilers) only export functions from a DLL if explicitly requested. The most common way to do this is to declare the function "dllexport", but you can also name the functions in a .DEF file as pass it to the linker. Note that you need to list the C++ mangled name in the .DEF file.

提交回复
热议问题