Static Link Library Used in QT -- *. Lib is converted to a static library in the. A format used by mingw. [reprinted]

Source: Internet
Author: User

Use the reimp.exe tool provided by mingw. this tool is generally stored in mingw
In directory, the README file is in the mingwdoc EIMP directory,

The method is simple, for example:

C: codeblocksmingwlibdx9> reimp d3d8. Lib

A "libd3d8. A" file is generated, which can be used by the mingw-based compiler link.

Using this method, I successfully converted the. Lib library of directx9c into the. A library, and compiled the generated DX project under codeblocks,

However, there are three. Lib files that cannot be converted using this method: dxerr. Lib, dxerr8.lib, and dxerr9.lib. Other methods are estimated,

However, it seems that none of them will affect the usage of the dx9c library. If necessary, try again.

There is another way, the source is:

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

I don't know if it is feasible. You can try it.

Both GCC and VC use coff format, so. obj. Lib in VC and. O used by GCC
. A is the same (in Windows), but the extension is different. You only need to change the name to OK! However, some libraries do not work, because the code in the library may use some compiler proprietary features. The. Lib made with VC may not be compiled (without symbols) in GCC, and vice versa.

The reimp readme document is as follows:

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
The
Corresponding. Def file (s) that it feeds to 'dltool' 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
Use for dlltool
--
Use for processing er

The '-- dump-symbols' option makes 'reimp 'use a quick method
Finding
Imported symbols and sending the names of found symbols
Stdout. If
Input Library contain non-imported symbols they will be
Listed as well.
Output symbols will have all decoration preserved
(I. e '_' Will prefix most
Symbols), So if you feed it to dlltool you
Shocould strip leading underscores.
For example

Echo exports> imp. Def
Reimp imp. Lib | SED's /_//'
> Imp. Def
Dlltool-k -- def imp. def -- output-lib libimp.
-- Dllname imp. dll

The '-- only-Def' option makes 'reimp 'stop after generating
. 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
The
DLL imported from when creating an import library. kernel32.dll
Will
Generate libkernel32.a and not libkernel32.a as it wocould 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
The '-- only-Def' and '-- dump-symbols' options.
You probably want
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

If there is no reimp

Download mingw-utils
Http://sourceforge.net/projects/mingw/files/MinGW/Utilities/mingw-utils/mingw-utils-0.3/mingw-utils-0.3.tar.gz/download

Download mingw-utils-0.3.tar.gz, decompress it, and copy the reimp to the bin directory of mingw.

Use reimp and dlltool
Go to cmd
Cd c:/MySQL/lib/OPT

Reimp-D libmysql. Lib

Dlltool-K-D libmysql. Def-l
Libmysql.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.