I'm on Ubuntu 18.04, GCC 7.4
I created a test shared-library then copy it to /usr/local/lib/ The .so file has been created like this:
gcc -Wall -fPIC -c src/Test.cpp -o obj/Test.o
gcc -shared -Wl,-soname,libhztest.so -o bin/libhztest.so obj/*.o
sudo cp bin/libhztest.so /usr/local/lib/hazeltest/
sudo chmod 777 /usr/local/lib/hazeltest/
Then I created a test app and tried to run it and I get : error while loading shared libraries: libhztest.so: cannot open shared object file: No such file or directory
If I do export a proper LD_LIBRARY_PATH and it works but I prefer to use ldconfig
Unfortunately ldconfig doesn't seem to link my library even though the directory /usr/local/lib/ is well included in the /etc/ld.so.conf
Anyone could tell me why this doesn't work? Thanks