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

10,865

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:
10,865
nineties
Author by

nineties

Updated on June 04, 2022

Comments

  • nineties
    nineties almost 2 years

    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?