mingw-utils, reimp, 把库文件从msvc格式(.lib)转化成MinGW格式(.a)的方法

目前的 CodeBlocks , dev c++ 中的都不带,要自己去下载 ,包含于 mingw-utils 中

http://sourceforge.net/projects/mingw/files/MinGW/Extension/mingw-utils/

--------------------------------------------------

http://www.codeguru.com/forum/showthread.php?t=389098

Reimp

Hello.
Where can i get the reimp util? I looked it up on google, it is suppousd to be in minGW, i dled all possible versions of it, it is not there.
Any ideas?
 
 
    
Re: Reimp

http://prdownloads.sourceforge.net/m...ar.gz?download

Note : With google, I simply searched for "reimp", and then clicked on the first link, which brought me to a page containing a direct link to the sourceforge.net's project of mingw-utils.
__________________
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.

Out of memory happens! Handle it properly!
Say no to g_new()!
 

--------------------------------------------------

http://www.appinn.com/freearc-winrar-7-zip-evaluation/

FreeArc / WinRAR / 7-Zip 评测

156

xrax168 同学针对三款压缩软件(商业 WinRAR、开源 7-ZIP / FreeArc 做了对比评测,如下:

FreeArc / WinRAR / 7 Zip 评测[图] | 小众软件

FreeArc 号称具有 WinRAR 7-Zip 两倍以上的压缩速度(在相同压缩效率下),拥有 ARC 压缩格式(也只能压缩这种格式,RAR 是 WinRAR 独有封闭格式,别的压缩软件都不能压缩这种格式),能解压 RAR、7Z、ZIP、CAB 等常用压缩格式,最新稳定版本为 0.666。

1.测试环境

为了进行对比,我采用了三种软件的最新版本:7-ZIP9.19版、WinRAR3.93版、FreeArc0.666版。机器配置为:Windows7 Ultimate、CPU:T6570(双核2.1GHz,2MB二级缓存)、2G DDR2内存。测试时没有别的软件运行,只运行相应的压缩软件。

2.测试方法

压缩时,FreeArc 采用 ARC 压缩格式,WinRAR 采用 RAR 格式、7-Zip 采用 7z 格式,压缩设置为默认设置、压缩等级为标准压缩方式;解压时,都为相应软件解压自有格式。要压缩的文件统一为233MB:357个文件夹,共7416个文件。这些文件主要是文字、网页、DOC、PDF等文件类型的,因为图片、音乐、视频都有各自的压缩方式,用压缩软件压缩不了多少容量。WinRAR 选择多线程模式、7-Zip 选择默认的2线程模式,FreeArc 没有多线程选择项,不过看压缩时的双核 CPU 两个核心的占用率,应该是默认开启多线程模式。

3.测试结果为

A. WINRAR压缩时间为 58.5 秒,压缩后的文件容量为 134MB,解压时间为 53 秒。
B. 7-ZIP压缩时间为 93.5 秒,压缩后的文件容量为 84.2MB,解压时间为 42 秒。
C. FREEARC压缩时间为 34 秒,压缩后的文件容量为 86.7MB,解压时间为 38 秒,解压 RAR 文件为 37.5 秒,解压 7z 文件为 38 秒。

从测试结果看,FreeArc 无论压缩时间、解压时间、压缩效率,都是王者。

FreeArc 具有 Windows 版本和 Linux 版本,有简体中文版本,可以把文件压缩为自解压文件(EXE格式),并可把其他压缩格式文件转换为 ARC 格式,拥有 256 位 AES、TWOFISH 高强度加密方式,可把常用压缩、解压菜单集成到鼠标右键、方便使用。不足就是没有分卷压缩方式、没有64位版本,不过,官方正在努力改进这些不足。

FreeArc 官方网站:http://freearc.org/

另外 xrax168 同学针对官方 TotalCommander 插件没有搞定,需要同学们前来帮忙。

P.S. 小众在微博: t.sina.com.cn/appinncom

--------------------------------------------------

http://blog.csdn.net/wanggang999/article/details/3284539

使用MinGW附带的工具reimp.exe,该工具一般在MinGW/bin目录下,其readme文档在MinGW/doc/reimp目录下,

方法很简单,比如:

C:/CodeBlocks/MinGW/lib/dx9>reimp d3d8.lib

就会生成一个“libd3d8.a”文件,这个文件就可以让基于MinGW的编译器链接使用了。

 

我用这个方法成功的把DirectX9c的.lib库转化成了.a库,并在CodeBlocks下编译成功了其生成的dx项目,

但是有三个.lib文件无法通过这个方法转换:DxErr.lib、DxErr8.lib、DxErr9.lib,估计其他方法,

但似乎没有他们也不影响DX9c库的使用,先这样,需要的话再想办法吧。

 

还有一个办法,来源是:

http://topic.csdn.net/t/20040721/11/3195357.htm

不知道是否可行,可以试试。

    GCC和VC都使用COFF格式,所以VC中的.obj   .lib与gcc用的.o   .a是一样的(在WINDOWS下),只是扩展名不一样,通常你只要改一下名称就OK啦!不过有些库不行,因为库中的代码可能会用到一些编译器专有的特 性,用VC做的.lib可能在gcc下没法通过编译(缺少符号),反之亦然。

 

 

reimp的readme文档内容如下:

 

README for reimp
================

* Overview

`reimp' is a tool to convert Microsoft's new-style (short) import
libraries to import libraries for win32 ports of GNU tools (mingw32,
cygwin).

`reimp' reads an MS import library and writes all imports to the
corresponding .DEF file(s) that it feeds to `dlltool' that creates the
import library.


* Invocation

Usage: reimp [options] IMPLIB

Options:
  -s, --dump-symbols      dump symbols to stdout
  -d, --only-def          only create .def files
  -c, --keep-case         keep case in lib*.a file names
  --dlltool <name>        use <name> for dlltool
  --as <name>             use <name> for assembler

The `--dump-symbols' option makes `reimp' use a quick method for
finding imported symbols and sending the names of found symbols to
stdout. If the input library contain non-imported symbols they will be
listed as well. The output symbols will have all decoration preserved
(i.e '_' will prefix most symbols), so if you feed it to dlltool you
should strip leading underscores. For example

        echo EXPORTS > imp.def
        reimp imp.lib | sed 's/_//' >> imp.def
        dlltool -k --def imp.def --output-lib libimp.a --dllname imp.dll

The `--only-def' option makes `reimp' stop after generating the .DEF
file(s).

By default `reimp' converts all output library names to lower-case. By
using the `keep-case' option `reimp' will use exactly the case of the
DLL imported from when creating an import library. KERNEL32.dll will
generate libKERNEL32.a and not libkernel32.a as it would be default.


* Notes on mixed libraries

If an input library contain regular objects (non-imports, i.e code and
data) `reimp' will write out those objects unless you specify one of
the `--only-def' and `--dump-symbols' options. You probably want to
include those objects as well in the generated library. `reimp'
doesn't do that automatically so you have to do it manually using
`ar', like this

        reimp imp.lib          # this generates several .o or .obj files.
        ar rcs libimp.a *.obj  # add them to library


* Contact information

URL: http://www.acc.umu.se/~anorland/gnu-win32/
Anders Norlander <anorland@hem2.passagen.se>

posted on 2012-02-06 11:00 clq 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/-clq/archive/2012/02/06/2339687.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值