avatar
Today is 星期天
2010年09月5日

2010年07月24日

从DLL文件导出对应的LIB文件

由 晨笛 — 分类目录: 未分类评论暂缺

一、VisualStudio中使用的.lib文件:
(1)使用pexports或VC自带的dumpbin.exe导出dll的def文件:
            pexports dll-file > def-file
            dumpbin /EXPORTS dll-file > def-file
            通过dumpbin产生的def文件,需要手工修改成符合def格式,如:

            LIBRARY sample.dll
            EXPORTS
                ??0IAccessContrl@@QAE@ABV0@@Z

            推荐使用pexports,它产生的def文件不需要修改
(2)使用VC自带的lib程序:
            lib /def:def-file /machine:i386 /out:lib-file

二、MingW使用的.a文件:
(1)使用pexports或是微软自带的dumpbin导出dll的def文件,推荐使用pexports,可以直接导出不需要修改的def文件.
(2)使用MingW自带的dlltool工具来生成.a文件
            dlltool -D sample.dll -d sample.def -l sample.a

pexports的网址是:http://www.emmestech.com/software/cygwin/pexports-0.43/download_pexports.html

评论暂缺 »

还没有任何评论。

留下评论

XHTML: 您可以选用这些标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

© 2010 晨笛的博客 All rights reserved - Wallow theme by TwoBeers Crew - Powered by WordPress - 使用愉快!