/lib/libmatrix.a: file not recognized: File format not recognized collect2: ld returned 1 exit statu

/lib/libmatrix.a: file not recognized: File format not recognized collect2: ld returned 1 exit status

Ask Question
up vote 2 down vote favorite

I'm trying to compile a makefile which includes the following line:

gcc -I. -I/home/usr/Documents/MTV/include -ggdb3 -Wall -O2 -o ascii2bin.c \
    -L. -L../lib -lmatrix -lseq_io -lpic -lm

And this is what I get:

../lib/libmatrix.a: file not recognized: File format not recognized
collect2: ld returned 1 exit status

Any idea on what might happen to libmatrix.a? How can I read what's inside libmatrix.a? I tried using the 'ar -t' command, but it also says file format not recognized.

The project was compiled on Cygwin before by others, and now I'm using ubuntu gcc to try to redo it, could this be the problem?

share improve this question
 
 
How are you trying to "compile a Makefile"? –  user529758  Jun 17 '13 at 17:35
 
@H2CO3 make is a compiler. –  Casey  Jun 17 '13 at 17:36
 
well, i meant using the command 'make'. –  nineties  Jun 17 '13 at 17:36
4  
@Casey euh, no, it's a build automation tool. Not even remotely a compiler. –  user529758  Jun 17 '13 at 17:37
4  
Does file ../lib/libmatrix.a tell you anything useful? –  twalberg  Jun 17 '13 at 18:01

1 Answer

active oldest votes
up vote 2 down vote accepted

A library file built for cygwin will not work on linux.

The library itself must be recompiled from source to match the details (ABI, dynamic system library dependencies, etc) of the system on which it is intended to be used.

Cygwin tries to be source compatible with Linux, so if you have the source rebuilding may be straightforward. But it is not binary-compatible, and libraries are basically binary building blocks with metadata to permit linking them together.

share improve this answer

你可能感兴趣的:(/lib/libmatrix.a: file not recognized: File format not recognized collect2: ld returned 1 exit statu)