I have a c++ program, which contains two classes. one of them is using libssh
and some of its functions and another one is for calculating cpu usage. there is a link of how I a built and added libssh
:libssh's functions couldn't be found on qt
my program works fine. now I want to build a .so
library out of it to use in other programs. first I made two .o file like this:
gcc -c -fPIC info.cpp -o info.o
gcc -c -fPIC cpuusage.cpp -o cpuusage.o
and I made a .so from them:
gcc -shared -o libsmc.so info.o cpuusage.o
whenever I want to use libsmc.so, I include info.h
, but the problem is that libssh
functions cannot be found. I think I have to add libssh
statically to my project. but I don't know how to!
Ps:I read this explanation :Using a shared library in another shared library , but this is for linking shared libraries that have been used in a program via command line, I don't wanna compile program with command line and want to link libraries constantly.