How to Update A. So Link in Program Path?

How to Update A. So Link in Program Path?

Some quick background, I am trying to get mosquitto to work with both websocket support and mysql back auth-plugin. I am using version 1.5.5 of the mosquitto broker as this works with the auth-plugin and supports websockets.

I build the program first using and older version of the libwebsocket, before realising that I needed to use version 2.4.2.

I am running Ubuntu 18.04 LTS

ldd /usr/local/sbin/mosquitto

linux-vdso.so.1 (0x00007ffcf7ff9000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3f2eb9a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3f2e7fc000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3f2e5f4000)
libssl.so.1.1 => /usr/local/lib/libssl.so.1.1 (0x00007f3f2e361000)
libcrypto.so.1.1 => /usr/local/lib/libcrypto.so.1.1 (0x00007f3f2de74000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f3f2dc6d000)
**libwebsockets.so.9 => /usr/lib/libwebsockets.so.9 (0x00007f3f2da47000)**
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3f2d656000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3f2efcd000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3f2d437000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f3f2d21a000)

How do I update this line libwebsockets.so.9 => /usr/lib/libwebsockets.so.9 (0x00007f3f2da47000).

I have rebuilt lws using 2.4.2 which gives the libwebsockets.so.12 object file but I don't know to link it to mosquitto?

Commands used to rebuild lws-2.4.2

cd /home/ubuntu/mqtt/websockets/
sudo cp /home/ubuntu/mosquitto_installer/install/libwebsockets-2.4.2.tar.gz .
sudo tar zxvf libwebsockets-2.4.2.tar.gz
sudo chmod 777 libwebsockets-2.4.2
cd libwebsockets-2.4.2/
mkdir build
cd build
sudo cmake ..
sudo make
sudo make install
sudo ldconfig

If this is off-topic just let me and I will post elsewhere.

1 Answer

I have to remove the old .so files from /usr/local/lib and rerun my script and now it is running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.