zoukankan      html  css  js  c++  java
  • 强制加载库

    VC中,如果隐式链接的lib或dll未被引用,编译器并不会去生成加载该lib或dll的代码,从VLD1.0版本中看到可以通过如下方式强制引用:

    // Force a symbolic reference to the global VisualLeakDetector class object from
    // the library. This enusres that the object is linked with the program, even
    // though nobody directly references it outside of the library.
    #pragma comment(linker, "/include:?visualleakdetector@@3VVisualLeakDetector@@A")

    其中,“?visualleakdetector@@3VVisualLeakDetector@@A”即vldmtdll.lib中VisualLeakDetector类的构造函数,

    通过dumpbin /SYMBOLS vldmtdll.lib 可以看到

  • 相关阅读:
    如何判断栈的增长方向
    时间复杂度
    shell基础part3
    shell基础part2
    shell基础part2
    linux基础part5
    linux基础part4
    linux基础part3
    linux基础part2
    shell基础part1
  • 原文地址:https://www.cnblogs.com/through/p/4946328.html
Copyright © 2011-2022 走看看