I am making a shared library using C language. This lib has a dependencies from libjpeg and X api. I am building it on Ubuntu 18.04 OS and to build it I use the following command:
gcc mycode.c -o libname.so --shared -lX11 -lXss -lXExt -ljpeg -fPIC.
I want to use this library on debian based operating systems, for example Debian OS. When I call functions of this library on Debian 9.9, I receive an exception
Unable to load a file libname.so or one of it's dependencies. But when I build this C code with the same command on Debian and further use it - all is working.
I assume that the problem is in libjpeg because on Ubuntu I use library called libjpeg but there is no library with the same name on Debian and I use libjpeg-turbo.
Help me please to realize how to build my library in Ubuntu and then use it on other Debian based systems.
Also, I want to mention that I am not an expert at Linux distributions and difference between them, and if things that I want to do are impossible, sorry for time wasting.