View mode: basic / threaded / horizontal-split · Log in · Help
February 16, 2005
Static libs usage
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
February 16, 2005
Re: Static libs usage
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.
February 16, 2005
Re: Static libs usage
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.
February 17, 2005
Re: Static libs usage
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
Top | Discussion index | About this forum | D home