A
A
Alexey2014-08-27 19:11:54
linux
Alexey, 2014-08-27 19:11:54

Why can't the Linux linker see the dynamic library?

There is a Raspberry Pi with the latest Raspbian Wheezy on board and a device with an interface based on an FTDI chip. Libraries were installed for the device (according to the attached manual ). The problem is that programs do not see these libraries.
Let's run the example that comes with the driver:

$ sudo ~/release/examples/EEPROM/read/./read
/home/pi/release/examples/EEPROM/read/./read: error while loading shared libraries: libftd2xx.so: cannot open shared object file: No such file or directory

No file you say? Checking dependencies:
$ sudo ldd ~/release/examples/EEPROM/read/./read
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6fb5000)
        libftd2xx.so => not found
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6e7a000)
        /lib/ld-linux-armhf.so.3 (0xb6fc3000)

Really not. But! We check which libraries are generally in the system (the output is truncated):
$ sudo ldconfig -v
/usr/local/lib:
        libftd2xx.so -> libftd2xx.so.1.1.12
/usr/lib:
        libftd2xx.so -> libftd2xx.so.1.1.12

And, lo and behold, there are libraries in the system. And even registered in two places. But the linker does not see them. Why?
I tried to prescribe separately the path to a separate folder with the library through the LD_LIBRARY_PATH variable. I tried to prescribe the same path through ld.so.conf.
And the most mystic is that on the same raspberry with Arch Linux everything works without any problems. Moreover, everything worked on Raspbian with the 3.10 kernel. But due to the untimely death of the SD card, I had to roll the system from scratch. And here is such an ambush.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2014-09-09
@WildHorn

The question is removed.
I pulled out the same library (libftd2xx.so) from a year-old backup, put it where it was needed and it all worked. I checked the files - the libraries have the same version (judging by the name), but the size is different.
The conclusion is that these Asians messed up something with the files on their site, so the library downloaded a year ago on Arch works, but the one downloaded now on fresh Debian no longer works.

D
Don Kaban, 2014-08-27
@donkaban

It is worth reading carefully www.opennet.ru/base/dev/shared_lib_intro.txt.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question