views:

141

answers:

1

When I'm linking .o files with the LD linker using MinGW on Windows, it gives me the error "file.o: File not recognized: file format not recognized". I've tried to do it with cygwin instread, but the same thing happens. Any suggestions?

A: 

Most likely you have a object file in a format that the linker does not understand. There are lots of different formats out there: COFF, OMF, ELF (the list goes on..)

Fortunately there is a free tool that lets you convert from one format to another. It also lets you take a look into the internals of the object format and tells you in which format a object file is encoded.

http://www.agner.org/optimize/#objconv

That little command line utility solved all the object format problems I ever had. It can even disassemble libs, object files, DLLs and executables.

Nils Pipenbrinck