www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Static libs usage

reply nail <nail_member pathlink.com> writes:
Hello.

I tried to link my dmd's lib/app with .lib file compiled with msvc. The
librarian says that COFF is not supported, use COFF20MF. Linker says that .lib
file is corrupted. Is there a way to use it, maybe some utilities to convert
from COFF format to that COFF20MF?

Victor Nakoryakov
nail-mail<at>mail<dot>ru
Feb 16 2005
next sibling parent Mike Parker <aldacron71 yahoo.com> writes:
nail wrote:
 Hello.
 
 I tried to link my dmd's lib/app with .lib file compiled with msvc. The
 librarian says that COFF is not supported, use COFF20MF. Linker says that .lib
 file is corrupted. Is there a way to use it, maybe some utilities to convert
 from COFF format to that COFF20MF?

COFF2OMF is the name of the utility you need to use to convert it from COFF to OMF format. Then you can link with it.
Feb 16 2005
prev sibling parent reply John Reimer <brk_6502 yahoo.com> writes:
nail wrote:
 Hello.
 
 I tried to link my dmd's lib/app with .lib file compiled with msvc. The
 librarian says that COFF is not supported, use COFF20MF. Linker says that .lib
 file is corrupted. Is there a way to use it, maybe some utilities to convert
 from COFF format to that COFF20MF?
 
 Victor Nakoryakov
 nail-mail<at>mail<dot>ru

COFF2OMF does not work reliably on all MS lib files. If the COFF file is in a newer MS COFF format, then you will need to find a MS linker that has a special commandline option to convert the new COFF to the older COFF format (finding the correct linker that does this can be tricky, in my experience). Once that's done, from what I understand, you can use COFF2OMF to convert the output .lib to the OMF format you need for linking with your D project. Yet, I don't know if even that works 100% of the time. If you do a search of the digitalmars C++ newsgroup, you should be able to find more information on this. This issue has come up before many times. - John R.
Feb 16 2005
parent nail <nail_member pathlink.com> writes:
In article <cv05ku$r5i$1 digitaldaemon.com>, John Reimer says...
nail wrote:
 Hello.
 
 I tried to link my dmd's lib/app with .lib file compiled with msvc. The
 librarian says that COFF is not supported, use COFF20MF. Linker says that .lib
 file is corrupted. Is there a way to use it, maybe some utilities to convert
 from COFF format to that COFF20MF?
 
 Victor Nakoryakov
 nail-mail<at>mail<dot>ru

COFF2OMF does not work reliably on all MS lib files. If the COFF file is in a newer MS COFF format, then you will need to find a MS linker that has a special commandline option to convert the new COFF to the older COFF format (finding the correct linker that does this can be tricky, in my experience). Once that's done, from what I understand, you can use COFF2OMF to convert the output .lib to the OMF format you need for linking with your D project. Yet, I don't know if even that works 100% of the time. If you do a search of the digitalmars C++ newsgroup, you should be able to find more information on this. This issue has come up before many times. - John R.

Thanks John. I'm stupid, I read COFF2OMF as COFF-twenty-MF, not as COFF-to-OMF :))) And I was very surprised when I found nothing in google on `COFF-twenty-MF` request :) Victor Nakoryakov nail-mail<at>mail<dot>ru
Feb 17 2005