Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use a static library compiled for different machine

I have obtained the code of a paper from the author. The problem is that he has compiled some parts into static libraries (.a) At the beggining I could not use it because I was having this error:

/usr/bin/ld: skipping incompatible ../lib/libmvvt.a when searching for -lmvvt
/usr/bin/ld: cannot find -lmvvt

I realised that it was a problem of compatibility. I compiled the code for the rest of the libraries and now I got it working except for one library for which he did not provide the source code (only the header).

After checking inside the library with readelf, I can see that the machine is MIPS R3000.

My machine is x86-64.

Is there a way that I can use the library in my machine without having to recompile it (since I don't have the code)?

Thanks!

like image 295
Roger Trullo Avatar asked Oct 16 '25 03:10

Roger Trullo


2 Answers

Is there a way that I can use the library in my machine without having to recompile it (since I don't have the code)

No.

like image 63
Andrey Rogov Avatar answered Oct 18 '25 16:10

Andrey Rogov


Static libraries are compiled objects. The same way you can't use an executable build for one architecture in a different incompatible architecture, you can't use static library in the same manner.

like image 21
SergeyA Avatar answered Oct 18 '25 18:10

SergeyA