Re: Using LIB Files in Delphi



"Chris.Cheney" <Chris.CheneyXXNOSPAMXX@xxxxxxxxx> wrote in
news:Xns997696BC7E3EAChrisCheneytesconet@xxxxxxxxxxx:

"Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx> wrote in
news:46a477a2$0 $327$e4fe514c@xxxxxxxxxxxxxx:

<alanglloyd@xxxxxxx> wrote in message
news:1185183207.213499.233940@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[...]
How can I use the LIB file under Delphi. Is there a simple approach,
or maybe I have to get a C programmer to write a DLL which wraps the
LIB file.

That's probably the simplest. Lib files are Right Out in Delphi as
far as I know.

Groetjes,
Maarten Wiltink




Alan,

Linking with C-derived object modules/libraries is something that I
have, so far, managed to avoid having to do. However, it is something
that I believe is possible - but I may be wrong.

See Delphi (7 or 2006, probably others too) Project Options - there
are options to generate C/C++ object files.

The utility coff2omf supposedly will convert LIBs to OMF. I believe
(but again am not 100% certain) that the .OBJ files that Delphi is
capable of linking in using the $L/$LINK directive are OMF.

Further research indicates that Borland's coff2omf won't do the job but
Digital Mars have a utility of the same name that might - however it's
chargeable. But see http://www.agner.org/optimize/#objconv for a free

"Object file converter

This utility can be used for converting object files between COFF/PE,
OMF, ELF and Mach-O formats for all 32-bit and 64-bit x86 platforms. Can
also be used as a cross-platform library manager, a dump utility, and a
powerful disassembler. Source code included (GPL)."

I've not used it myself ...

Chris


Google throws up a number of coff/omf hits particularly wrt linking
with Python.

I for one would be interested in hearing how you get on.

Regards

Chris

.



Relevant Pages

  • Basic linking question
    ... I have a lib file and a set of object files. ... documentation on how to build an executable module to be uploaded on the ...
    (comp.os.vxworks)
  • Re: dll problems in VC++
    ... You can make a .lib file INSTEAD of a .exe, ... of the object files to the library instead. ... Not once the DLL has been linked. ...
    (microsoft.public.vc.language)
  • Re: Visual C++ LIB to Delphi
    ... Oh, by the way, Visual C++ object files and Delphi object files are incompatible with each-other. ... You may be able to run the COFF2OMF tool on the Visual C++ lib file to get a Borland-compatible lib ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Visual C++ LIB to Delphi
    ... > me that he will provide me a DLL file - thats the easy way. ... > possible to create a LIB file instead so I can embed it inside the ... Delphi does not support importing lib files but you can use ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Delphi 2006 and C++
    ... > But it might be possible to create a project group with a C++ project, ... and make it use the generated obj files. ... You can already do that right now, using BCB and Delphi. ... problems with C++ object files, but C object files are OK. ...
    (borland.public.delphi.non-technical)