Construcción de LIB importadas 32 y 64 para los comp. de C

Post Reply
xmanuel
Posts: 774
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla
Been thanked: 5 times
Contact:

Construcción de LIB importadas 32 y 64 para los comp. de C

Post by xmanuel »

Abro este hilo porque creo que sería bueno que los que lo tengáis esos procedimientos los compartáis con todos.
Para 32 bit y 64 de los principales compiladores de C:

Bcc32 y Bcc54
Msvc32 y Msvc64
MinGW32 y MinGW64
y otros

:D
Last edited by xmanuel on Wed Dec 18, 2019 9:04 am, edited 1 time in total.
______________________________________________________________________________
Sevilla - Andalucía
User avatar
Compuin
Posts: 1259
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 22 times
Been thanked: 4 times
Contact:

Re: Construcción de LIB importadas 32 y 64 para los comp. de C

Post by Compuin »

Para Borland 64

MKEXP.EXE, the 64-bit Windows Import Library Tool for C++
Go Up to Command-Line Utilities Index

MKEXP.EXE is the 64-bit Windows counterpart of IMPLIB.EXE, the Import Library Tool for Win32. However, MKEXP does not support all the same options supported by IMPLIB.

MKEXP produces GNU-style (ELF format) archive files (.a files).

You can use .DLL, .DEF, or OMF files with MKEXP.

Examples
Generating an import library from a DLL:

mkexp mydll.a mydll.dll
Generating an import library from a .DEF file:

mkexp mydll.a mydll.def
The resulting .a files are included in the library section of the link command line for any application or DLL that uses mydll.dll. The .a files that are produced by mkexp are GNU style archive files containing a single object file with an Embarcadero specific set of data to describe all the exports from the DLL.

Command-Line Help
C:> mkexp
mkexp.exe: Copyright (c) 2012 Embarcadero Technologies, Inc.
All rights reserved.

usage: mkexp [-n] [-d] [-o] [-p] outputfile inputfile
Creates an import archive from an input file.
Valid input files are OMF object files that contain only
EXPDEF COMENT records, PE files, and DEF files.

-f: prefer to link by ordinal (dangerous)
-d: assume input is a DEF file
-o: assume input is an OMF object file
-p: assume input is a PE file

File type is by default based on extension:
OMF: .obj
DEF: .def
PE: .dll, .exe
FWH 25.01 | Hbmk2 32/64 Bits (Build 19.29.30133) | Microsoft Visual C 32 Bits | MySql 8.0.24 32/64 Bits | VS Code
xmanuel
Posts: 774
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla
Been thanked: 5 times
Contact:

Re: Construcción de LIB importadas 32 y 64 para los comp. de C

Post by xmanuel »

Construccion de librerias de importacion

BCC32

Code: Select all | Expand


ImpLib LibMySQL.lib LibMySQL.dll
 


BCC64

Code: Select all | Expand


mkexp libmysql.a libmysql.dll
 


MSVC32

Code: Select all | Expand


call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
lib /def:LibMySQL.def /machine:x86 /out:LibMySQL.lib
 


MSVC64

Code: Select all | Expand


call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
lib /def:LibMySQL.def /machine:x64 /out:LibMySQL.lib
 


MinGW 32 y 64 (Según entorno activo en el PATH)

Code: Select all | Expand


gendef -a libmysql.dll
dlltool -k -d libmysql.def -l libmysql.a
 


Si alguien quiere poner otros compiladores, el hilo sigue abierto
8)
______________________________________________________________________________
Sevilla - Andalucía
Post Reply