Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] ld cannot find lpaho-mqtt3c

It looks like maybe the installer ran ldconfig before creating the soft links for the libraries. Try to run ldconfig again to update its cache:
$ sudo /sbin/ldconfig
Or just run the build/install again:
$ sudo make install
That might work if things were done in the improper order the first time.

If that doesn't fix it, look to see if it actually placed the libraries and links into /usr/local/lib as the installer claimed:
$ ls -l /usr/local/lib/libpaho*
total 1828
lrwxrwxrwx 1 root root     19 Sep 28 02:07 libpaho-mqtt3a.so -> libpaho-mqtt3a.so.1
lrwxrwxrwx 1 root root     23 Sep 28 02:07 libpaho-mqtt3a.so.1 -> libpaho-mqtt3a.so.1.2.0
-rw-r--r-- 1 root root 185064 Sep 28 02:07 libpaho-mqtt3a.so.1.2.0
lrwxrwxrwx 1 root root     20 Sep 28 02:07 libpaho-mqtt3as.so -> libpaho-mqtt3as.so.1
lrwxrwxrwx 1 root root     24 Sep 28 02:07 libpaho-mqtt3as.so.1 -> libpaho-mqtt3as.so.1.2.0
-rw-r--r-- 1 root root 211896 Sep 28 02:07 libpaho-mqtt3as.so.1.2.0
-rw-r--r-- 1 root root 302504 Sep 28 02:07 libpaho-mqtt3as-static.a
-rw-r--r-- 1 root root 268630 Sep 28 02:07 libpaho-mqtt3a-static.a
lrwxrwxrwx 1 root root     19 Sep 28 02:07 libpaho-mqtt3c.so -> libpaho-mqtt3c.so.1
lrwxrwxrwx 1 root root     23 Sep 28 02:07 libpaho-mqtt3c.so.1 -> libpaho-mqtt3c.so.1.2.0
-rw-r--r-- 1 root root 166912 Sep 28 02:07 libpaho-mqtt3c.so.1.2.0
lrwxrwxrwx 1 root root     20 Sep 28 02:07 libpaho-mqtt3cs.so -> libpaho-mqtt3cs.so.1
lrwxrwxrwx 1 root root     24 Sep 28 02:07 libpaho-mqtt3cs.so.1 -> libpaho-mqtt3cs.so.1.2.0
-rw-r--r-- 1 root root 197856 Sep 28 02:07 libpaho-mqtt3cs.so.1.2.0
-rw-r--r-- 1 root root 279652 Sep 28 02:07 libpaho-mqtt3cs-static.a
-rw-r--r-- 1 root root 244890 Sep 28 02:07 libpaho-mqtt3c-static.a

Frank

On 11/22/2017 02:15 AM, Heloise Chevalier wrote:

Hi, 

I have trouble compiling a file while linking it to the paho.mqtt.c library. I run gcc -o file file.c -lpaho-mqtt3c  -I src -lpthread -L build/output to compile it, but get a /usr/bin/ld cannot find lpaho-mqtt3c error.

Here is the output from the make install of the library, which shows the symlink has been created, so the problem does not come from that :

mkdir -p build/output/samples
mkdir -p build/output/test
echo OSTYPE is Linux
OSTYPE is Linux
install -m 644  build/output/libpaho-mqtt3c.so.1.0 /usr/local/lib
install -m 644  build/output/libpaho-mqtt3cs.so.1.0 /usr/local/lib
install -m 644  build/output/libpaho-mqtt3a.so.1.0 /usr/local/lib
install -m 644  build/output/libpaho-mqtt3as.so.1.0 /usr/local/lib
install  build/output/MQTTVersion /usr/local/bin
/sbin/ldconfig /usr/local/lib
ln -s libpaho-mqtt3c.so.1 /usr/local/lib/libpaho-mqtt3c.so
ln -s libpaho-mqtt3cs.so.1 /usr/local/lib/libpaho-mqtt3cs.so
ln -s libpaho-mqtt3a.so.1 /usr/local/lib/libpaho-mqtt3a.so
ln -s libpaho-mqtt3as.so.1 /usr/local/lib/libpaho-mqtt3as.so
install -m 644 src/MQTTAsync.h /usr/local/include
install -m 644 src/MQTTClient.h /usr/local/include
install -m 644 src/MQTTClientPersistence.h /usr/local/include

I searched for similar issues already, but none of the solutions given seem to work here. I am working on a computer running CentOS 6.4. What bugs me the most about this is that I already successfully installed and used this library previously on another computer, also running CentOS 6.

Thanks for any help



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev


Back to the top