MarGru
MarGru

Reputation: 11

Dynamically linked library cannot be found in cross-compilation

I've been trying to dynamically link a shared object with a binary. Everything is fine until I try to run it, which gives me:

/tmp/test: error while loading shared libraries: libxl.so: cannot open shared object file: No such file or directory

also ldd shows that the file cannot be found. Of course, the library in question is in the default location (/lib/arm-linux/gnueabihf). I have also run ldconfig after library was copied there.

I have checked following things:

The library is created as:

ELF 32-bit LSB shared object, ARM, EABI4 version 1 (SYSV), dynamically linked

while the test binary is:

ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked

Can the EABI version cause those kind of problems with running? Is there anything else I can try to make it run?

Upvotes: 1

Views: 556

Answers (1)

payman
payman

Reputation: 310

Library path must be the location of libraries in the HOST machine not the target machine. It seems that "/lib/arm-linux/gnueabihf" is the location of library in your target machine.

Find the correct path of libxl.so in your toolchain sysroot.

Upvotes: 0

Related Questions