Links can be specified by the-L and-l, so the link can pass, but at runtime, the system still cannot find the specified library, which requires a simple configuration.
Workaround 1:
You can add the path of your own library directly to your/etc/ld.so.conf file . But generally the content in this file is a "include/etc/ld.so.conf.d/*.conf", so it is best to create a new file under the/etc/ld.so.conf.d/directory, such as "xxx.conf", and then add the path of your own library into this conf file.
After modifying the file, run/sbin/ldconfig-v as root. This step is essential, don't lose it.
Then re-run your own program, there is no problem.
Workaround 2:
If you know the version number of a linked library file, you can create a soft-link file for that library file in the same directory as the library file, such as:
I want to link libsdl.so, can use Ln-s libsdl.so libsdl-1.2.so.o to create a soft link with the version number. Then run the program again and it will be fine.
Linux Run Error: Error while loading shared Libraries:xxx.so.0:cannot open shared object File:no such fil