读书人

VC6开发的简单static library,为何用d

发布时间: 2012-04-22 18:34:46 作者: rapoo

VC6开发的简单static library,为何用dumpbin不能查看到其包含的函数?
我用dumpbin可以查看到系统提供的一些static library的函数情况,比如VC98\Lib目录下的所有lib都可以的。

开发的这个简单lib,编译,用调用程序调用运行,一起正常。

难道,为了使dumpbin可以查看到其函数情况,需要一些额外的设置???

lib:http://files.cnblogs.com/silva/staticLibTest.lib.zip
source code: http://files.cnblogs.com/silva/staticLibTest.zip



[解决办法]
实际上可以看到,我用你传上来的库,使用“DUMPBIN.EXE staticLibTest.lib /SYMBOLS“ 看到的结果如下,红色的为add函数:
Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


Dump of file staticLibTest.lib

File Type: LIBRARY

COFF SYMBOL TABLE
000 00000010 DEBUG notype Filename | .file
C:\Documents and Settings\xx46928\Desktop\MyProjects\staticLibTest\lib.cpp
006 000B1FE8 ABS notype Static | @comp.id
007 00000000 SECT1 notype Static | .drectve
Section length 38, #relocs 0, #linenums 0, checksum 0
Relocation CRC 00000000
00A 00000000 SECT2 notype Static | .debug$S
Section length 442, #relocs 0, #linenums 0, checksum 0
Relocation CRC 00000000
00D 00000000 SECT3 notype Static | .text
Section length 25, #relocs 0, #linenums 3, checksum F3FB8520, selection 1 (pick no duplicates)
Relocation CRC 9135B501
010 00000000 DEBUG notype Filename | .file
c:\documents and settings\xx46928\desktop\myprojects\staticlibtest\lib.cpp
016 00000000 SECT3 notype () External | _add tag index 00000018 size 00000025 lines 000005CB next function 00000023
018 00000000 SECT3 notype BeginFunction | .bf
line# 0004 end 00000025
01A 00000003 SECT3 notype .bf or.ef | .lf
01B 00000025 SECT3 notype EndFunction | .ef
line# 0006
01D 00000000 SECT4 notype Static | .debug$S
Section length 69, #relocs 2, #linenums 0, checksum 0, selection 5 (pick associative Section 3)
Relocation CRC B33CA6B9
020 00000000 SECT5 notype Static | .text
Section length 26, #relocs 0, #linenums 3, checksum 3A8B6B13, selection 1 (pick no duplicates)
Relocation CRC C52DE747
023 00000000 SECT5 notype () External | _mul
tag index 00000025 size 00000026 lines 00000680 next function 00000000
025 00000000 SECT5 notype BeginFunction | .bf
line# 0009 end 00000000
027 00000003 SECT5 notype .bf or.ef | .lf
028 00000026 SECT5 notype EndFunction | .ef
line# 000b
02A 00000000 SECT6 notype Static | .debug$S
Section length 69, #relocs 2, #linenums 0, checksum 0, selection 5 (pick associative Section 5)
Relocation CRC C67F8C03
02D 00000000 SECT7 notype Static | .debug$T
Section length 64, #relocs 0, #linenums 0, checksum 0
Relocation CRC 00000000

String Table Size = 0x0 bytes

Summary

514 .debug$S
64 .debug$T
38 .drectve
4B .text

[解决办法]
你看的是import library, 不是 static library
静态库没有export节

读书人网 >C++

热点推荐