简体   繁体   中英

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!

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM