Link to home
Start Free TrialLog in
Avatar of Hannes42
Hannes42

asked on

Linking static C .lib files?

How is linking a static .lib file done in Delphi, and how are the functions in this .lib called?
Avatar of davidheffernan
davidheffernan

This isn't done in Delphi - you can link to a DLL either dynamically (GetProcAddress) or statically using the Delphi external keyword.  Sorry!
ASKER CERTIFIED SOLUTION
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Extracting obj files will only work if the lib uses OMF objects.  Borland's C compiler outputs OMF.  Microsoft and Intel compilers output COFF.  Anyone know how to convert OMF to COFF and vice versa?
Converting from COFF to OMF? Maybe by using a disassembler to turn the COFF obj into assembler-code and then compile this using the right assembler to create an OMF obj.
But I wonder, is it really impossible to mix these two?
I've found the answer to my own question - the Borland utility coff2omf which does what it says!  And it works!
Cool! I knew there was some trick...
Yeah but I don't think it works for static LIB files.  That is it will only convert ones which are stubs for linking to DLLs.
Avatar of Hannes42

ASKER

I'll go the build-a-dll-from-it way. Thanks.
How do I use .lib files in C#