Forcing symbol export with MSVC

后端 未结 5 548
我寻月下人不归
我寻月下人不归 2020-12-25 08:38

I have a application and several plugins in DLL files. The plugins use symbols from the application via a export library. The application links in several static libraries a

5条回答
  •  梦谈多话
    2020-12-25 09:38

    The /INCLUDE directive can be used to force the MSVC linker to include a symbol. Alternatively, /OPT:NOREF can be used to disable removal of unused symbols in general.

    A common approach is to create a single unused function that references all objects exported for your plugins. Then you only need a single /INCLUDE directive for that function.

提交回复
热议问题