强制加载库
2015-11-07 23:15
246 查看
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 可以看到
// 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 可以看到
相关文章推荐
- C++ sstream 中处理字符串
- CSS盒子模型
- hdu 4467 Graph 阀值
- ZOJ 2965 模拟 (A)
- android 动画 amintorset 的使用
- Day 5(11.7):(2)实训--数据的完整性
- 典型的指针笔试题
- 收集的一些学习ios的好网站
- 夺命雷公狗ThinkPHP项目之----商城9商品后台无限极分类
- Android json的使用
- ios面试题
- [LeetCode]Palindrome Number
- Myeclipse-解决Failed to load the JNI shared library一种方法
- 全文检索引擎Solr系列—–全文检索基本原理
- 快速排序
- Uva1594——Ducci Sequence
- 发表第一个博客.
- ZendFramework 入门教程
- AIX 系统编译Lzo和Lzop源码
- android:scrollbarStyle属性及滚动条和分割线覆盖问题