My error was also related to not finding the required .so
file by a service.
I used LD_LIBRARY_PATH
variable to priorities the path picked up by the linker to search the required lib.
I copied both service and .so
file in a folder and fed it to LD_LIBRARY_PATH
variable as
LD_LIBRARY_PATH=. ./service
being in the same folder I have given the above command and it worked.