美文网首页
静态链接禁用优化,/OPT:NOREF /WHOLEARCHIV

静态链接禁用优化,/OPT:NOREF /WHOLEARCHIV

作者: XBruce | 来源:发表于2022-06-24 09:41 被阅读0次

    显示加载指定的Api,即便linker suppose it was not used.
    My current solution (hack?) is to use a Ruby script as a post build step on my libraries. This script uses the dumpbin.exe tool to find all symbols containing the word 'forceLink', and it outputs a header file containing

    pragma comment(linker, "/include:symbol")

    for each of the symbols. I then include that header file from my main project, and then everything just works.
    Thanks to everybody suggesting the dumpbin+grep+pragma comment(linker,...) workaround.

    #pragma comment(linker, "/include:symbol")
    
     #pragma comment(linker, "/include:?emptyreference@Noisy@@QAEXXZ")
    

    相关文章

      网友评论

          本文标题:静态链接禁用优化,/OPT:NOREF /WHOLEARCHIV

          本文链接:https://www.haomeiwen.com/subject/smevvrtx.html