Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2450
  • Last Modified:

COFF to OMF import library conversion

Does anybody know if there is a utility that can convert Visual C++ .lib files (COFF) to Borland C++ (OMF)? If not, how could I go about writing a utility to do this?
Thanks in advance.
0
eppsman
Asked:
eppsman
1 Solution
 
ylCommented:
If you want to convert an import library you can create the OMF library directly from the DLL using Borland's implib utility.
0
 
nietodCommented:
If the library contains functions that are not declared extern "C" converting the library file won't do you much good anyway.  VC and BC use different schemes for name decorating so you won't be able call functions written in VC by BC.  If the functions are  declared extern "c" this is not a problem, however.  Your best bet is to recompile the source code under BC.
0
 
eppsmanAuthor Commented:
Sorry, but I already know that I can do that. The DLL I happen to be working with is KERNEL32.DLL. I am using the thunking functions in my Borland C++ program, but I am receiving linker errors. It seems that the entries in import32.lib for the QT_Thunk function aren't linking properly. I do have the thunk32.lib file from the Microsoft platform SDK, however. I know that I cannot link to this .lib directly, because it is a COFF lib file. If I could convert it, or if somebody could give me some pointers as to how I could write a conversion utility, it would be great. Or, if you have had a similar problem, perhaps you have a solution. Thank you.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
ylCommented:
I has a similar problem. What I did finally is wrote the 32 bit thunking dll using VisualC++.
0
 
eppsmanAuthor Commented:
Unfortunately, I do not have access to Visual C++. The only compiler I have is Borland C++ 5.0
0
 
NexialCommented:
I believe that there are linkers that accept both formats, so you would not have to do the conversion.   I am explicitly thinking of the linker for IBM's Visual Age system.  (I did not go hunting - which is why this is a comment). If you can acquire such a linker then, it could obviate the need for the conversion.

0
 
RLMCommented:
I ran into same problem. I write in Borland Tasm but need DirectX libs which are COFF. Since Borland's linker only supports OMF, I have to link using VC's linker which supports both. This kinda sucks though since now my debugger is useless (VC's linker doesn't recognise debug info in OMF obj's). I looked everywhere for conversion utility but came up empty handed. C'est la vie.
0
 
eppsmanAuthor Commented:
Well, maybe I'll need to use the VC++ linker then... Thanks for your help.
0
 
Tommy HuiCommented:
I think the Watcom or Symantec compiler has such a tool. I don't remember exactly what it is, but they do have one.
0
 
KrueckeCommented:
When using Borland C++ Builder there is a command line utility shipped called coff2cob.exe (located in the bin folder). Maybe this is helpful for you
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now