您的位置:首页 > 其它

使用DLL文件生成LIB文件实现动态链接

2013-11-21 13:39 561 查看
以编译wxPython所需要的unicows.lib文件为例进行说明。

用VS编译wxPython时提示无法打开unicows.lib文件,经核实,该文件是为支持陈旧Windows版本的Unicode而提供,全称为Microsoft Layer for Unicode on Windows。在微软官网下载到unicows.exe文件,解开后得到最重要的unicows.dll和一个pdb文件,而离连接程序需要的.lib文件有些距离,好在以前弄过用dumpbin和lib工具制作过.lib文件,于是重新动手自己做,执行

dumpbin /exports unicows.dll > unicows.def

编辑unicows.def文件,将如下内容格式编辑替换:

...

1 0 0002DD6C AcquireCredentialsHandleW =
_GodotAcquireCredentialsHandleW@36

2 1 0000EC60 AddAtomW = _GodotAddAtomW@4

3 2 0001DDBF AddFontResourceW =
_GodotAddFontResourceW@4

...

编辑后的内容如:

EXPORTS

AcquireCredentialsHandleW @ 1

AddAtomW @ 2

AddFontResourceW @ 3

...

保存后执行

lib /def:unicows.def

就生产了lib文件了,可以加入工程连接应用程序啦。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: