edorfaus / TEMPered

C library and program for reading the TEMPer family of thermometer and hygrometer devices.
http://edorfaus.wordpress.com/
BSD 2-Clause "Simplified" License
87 stars 50 forks source link

Troubleshooting "missing" library files that actually exist #36

Open JeffMings opened 9 years ago

JeffMings commented 9 years ago

Hello! This project is the only one that wants to compile under Centos 7 with a newer version of the TEMPerHum hardware. However, even though CMake compiles successfully and hid-query runs correctly, tempered throws a library file error:

tempered: error while loading shared libraries: libtempered.so.0: cannot open shared object file: No such file or directory

The files are in /usr/local/lib64:

[root@WardCamPC local]# pwd /usr/local [root@WardCamPC local]# ls -alh lib64 total 60K drwxr-xr-x. 2 root root 4.0K Jun 5 15:10 . drwxr-xr-x. 13 root root 4.0K Apr 27 17:56 .. lrwxrwxrwx 1 root root 16 Jun 5 15:10 libtempered.so -> libtempered.so.0 -rwxr-xr-x 1 root root 36K Jun 5 15:09 libtempered.so.0 lrwxrwxrwx 1 root root 21 Jun 5 15:10 libtempered-util.so -> libtempered-util.so.0 -rwxr-xr-x 1 root root 13K Jun 5 15:09 libtempered-util.so.0

I tried making symbolic links int /usr/local/lib , but that didn't help.

How can I troubleshoot this? Thanks!

ajwittman commented 9 years ago

I am also having the same issue when trying to run tempered:

tempered: error while loading shared libraries: libtempered.so.0: cannot open shared object file: No such file or directory

In addition, if I try to run hid-query I get the error:

hid-query: error while loading shared libraries: libhidapi-hidraw.so.0: cannot open shared object file: No such file or directory

When I do find / -name libtempered.so.0 I find the file in the following locations:

/usr/TEMPered/libtempered/libtempered.so.0 /usr/local/lib64/libtempered.so.0

I am running Centos 6.6. hidapi installed with no problems and I did not get any errors while compiling TEMPered.

kronikabis commented 9 years ago

I think Ubuntu it is looking in /lib a quick and dirty was on my machine was 'ln -sf /usr/local/lib/x86_64-linux-gnu/libtempered.so.0 /lib/libtempered.so.0' in your case 'ln -sf /usr/local/lib64/libtempered.so.0 /lib/libtempered.so.0'

But the problem is in the compiler script i believe

ajwittman commented 9 years ago

I tried the sym links and still no luck. Definitely seems like an error in the compiler script though... Were you able to find anything? I tinkered with it for a while, but couldn't find it.

jpmorris commented 8 years ago

sudo cp /usr/local/lib/x86_64-linux-gnu/libtempered* /usr/lib/x86_64-linux-gnu/

works for me (on ubuntu)

KazimierzFreightliner commented 8 years ago

You have to add /usr/local/ib/x86_64-linux/gnu/libtempered directory (or wherever libs are) to ldconfig. To do this simply create file /etc/ld.so.conf.d/tempered.conf and put path to your lib directory there, one path in one line.

endolith commented 7 years ago

@KazimierzFreightliner That doesn't work for me

~/t/TEMPered> la /usr/local/lib/libtempered*
lrwxrwxrwx 1 root root  16 Nov  2 23:55 /usr/local/lib/libtempered.so -> libtempered.so.0
-rw-r--r-- 1 root root 36K Nov  2 23:55 /usr/local/lib/libtempered.so.0
lrwxrwxrwx 1 root root  21 Nov  2 23:55 /usr/local/lib/libtempered-util.so -> libtempered-util.so.0
-rw-r--r-- 1 root root 14K Nov  2 23:55 /usr/local/lib/libtempered-util.so.0

~/t/TEMPered> cat /etc/ld.so.conf.d/tempered.conf
/usr/local/lib/libtempered.so.0

~/t/TEMPered> tempered
tempered: error while loading shared libraries: libtempered.so.0: cannot open shared object file: No such file or directory
KazimierzFreightliner commented 7 years ago

Well, sorry to hear that. Unfortunately my TEMPerHum has broken down. I've bought $10 digitemp-compatible replacement and this one is working OOB with "digitemp" centos package.

endolith commented 7 years ago

@KazimierzFreightliner Can you link to what you bought?

KazimierzFreightliner commented 7 years ago

I've bought it here: http://allegro.pl/termometr-usb-czujnik-temperatury-ds18b20-pl2303hx-i6542790166.html It's Prolific PL2303HX USB-RS232 converter with DS18B20 thermometer.

endolith commented 7 years ago

Ah it's not a humidity sensor. Ok, thanks.

jeanrob98 commented 5 years ago

compiling and installing the tempered software puts the library files in /usr/local/lib (as mentioned above). On a debian stretch (9) system, that directory will be searched (as per the /etc/ld.so.conf.d/libc.conf file). But you have to run the 'ldconfig -v' command to actually make it register the newly installed libraries. Once run, you can test that the loader has found the libraries by doing 'ldd tempered' and you will see that it found them (or not, depending).

PrestonL commented 3 years ago

I had the same problem and adding the library to /etc/ld.so.conf.d/tempered.conf and running ldconfig -v afterwards ended up working, I'm guessing something should be adjusted in the make files so that make install will end successfully without having to do this.

preston@paducahix-raspi:~# cat /etc/ld.so.conf.d/tempered.conf
/usr/local/lib/libtempered.so.0

preston@paducahix-raspi:~# ldconfig -v
 . . .
/usr/local/lib:
    libtempered-util.so.0 -> libtempered-util.so.0
    libtempered.so.0 -> libtempered.so.0
 . . .

preston@paducahix-raspi:~# tempered
/dev/hidraw1 0: temperature 27.11 °C
/dev/hidraw1 1: temperature 27.44 °C