Solve Linux error while loading shared libraries: cannot open shared object file: No such file or directory, errorwhileloading
To install the latest Emqtt version, follow the instructions in the official documentation to report the following error:
Linux error while loading shared libraries libsctp. so.1: cannot open shared object file: No such file or directory
I have found some articles on the Internet to solve my problems. I will post them here. You can refer to these articles to solve similar problems.
1. Search for the file locally
Command: wheris libsctp. so.1
First, check whether a local file exists. If yes, skip to Step 3. I cannot find the result here.
2. Download libsctp from google.
This website has a lot of so file downloads: https://www.rpmfind.net/
Https://www.rpmfind.net/linux/RPM/centos/6.8/x86_64/Packages/lksctp-tools-1.0.10-7.el6.i686.html
RPM installation, refer
Http://www.centoscn.com/CentOS/help/2013/1019/1906.html
Wheris libsctp. so.1 after installation
It was found that it was installed under usr/lib.
Run./bin/emqttd consystemic again, or an error is returned.
3. It is suspected that it is an environment variable LD_LIBRARY_PATH.
The system does not know which directory xxx. so is stored. In this case, add the directory xxx. so to/etc/ld. so. conf.
In general, there are a lot of so files stored in the directory/usr/local/lib. Find them under this directory and find the. so file you need.
Therefore, add the/usr/local/lib line to/etc/ld. so. conf, save the line, and then run:/sbin/ldconfig-v to update the configuration.
In my case, after rpm, the so file is installed in/usr/lib, and this directory does not need to be configured.
You can refer:
Http://blog.csdn.net/sahusoft/article/details/7388617
Here, an error is returned after/sbin/ldconfig is updated. However, the error message has changed:
Wrong ELF class: ELFCLASS32
4. After the query, it should be 32-bit or 64-bit. The Emqttd I installed is a 64-bit version.
Use commands
File/usr/lib64/libsctp. so.1 is found to be a link to 'libsctp. so.1.0.17'
File/usr/lib64/libsctp. so.1.0.17 is found to be a 32-bit file.
It seems that 64-bit Emqtt cannot use 32-bit so files.
5. re-install the 64-bit version of google libsctp with rpm. Before installation, run rpm-e to uninstall the original 32-bit version.
After 64-bit installation, ldconfig. Run again. The emqtt service is successfully enabled and the problem is solved.