Mail Archives: djgpp/1995/07/13/14:12:08
> I tried to link my object-file to a Borland .lib-file and always got the
> message: file not recognized: File format not recognized.
>
> Now maybe anyone can help me by either finding a programm, which would convert
> those Borland .lib or Microsoft .obj files to a format recognized by
> djgpp, or by finding a bfd-library, which would make them readable by 'ld'.
This is discussed in the DJGPP FAQ list, section 17.4:
17.4 Q: I have a set of useful functions in a .obj format, but no source
code. Can I use them with my DJGPP program?
Q: I have this ACMELUXE.LIB library of functions which I want to
use. I've extracted all the .obj files, but when I try to link
them with my program, gcc complains: ``File format not
recognized''. Can't I use these object files?
Q: I've got a bunch of .obj files I want to use. I've ran AR to
make a Unix-style .a object library, but got an error message
from gcc saying ``couldn't read symbols: No symbols''. How can I
link them with my code?
A: Sorry, you can't. The GNU linker called by gcc doesn't
understand the format of .obj files which other DOS-based
compilers/assemblers emit. Unless you can get the source of
those functions and compile them with gcc, you won't be able to
use them. (You can also try using LIB32 librarian from Microsoft
C8 to convert object files to COFF.) But don't feel too bad
about it: most probably, they were written for real-mode
programs, and without extensive modifications would have crashed
your program anyway...
The latest version of the FAQ is available as faq102.zip from the same place
you get DJGPP. Or point your Web browser to this URL:
http://www.delorie.com/djgpp/faq
There is more info in the FAQ about this issue, so if you need this real bad,
read Chapter 17 there which is called ``Converting DOS Programs/Libraries to
DJGPP''.
- Raw text -