I have a .cpp code I wrote, which is written around a commercial software program where they provide a big c++ library class to use.
I want to static link their one shared object libtdfdll.so
into my executable. They do not provide me with a libtdfdll.a
file just the one .so
file. I am doing this in SLES 11.4 using g++ 4.8.3.
my cpp file is process_tdf_v12.5.cpp
Here is what I do now for basic dynamic linking which works:
g++ process_tdf_v12.5.cpp -I../tdflibs12.5/include -L../tdflibs12.5/lib -ltdfdll -lm
this also works for compiling/linking:
g++ process_tdf_v12.5.cpp -I../tdflibs12.5/include ../tdflibs12.5/libtdfdll.so -lm
but when I run my executable I get
error while loading shared libraries: libtdfdll.so.1: cannot open shared object file: No such file or directory
unless I do a
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/ron/tdflibs12.5/lib
which I do not want to do.
I want my one executable from my process_tdf_v12.5.cpp
to contain the specific version 12.5 of the tdflibs12.5/lib/libtdfdll.so
so that I do not need to copy the correct 12.5 version of libtdfdll.so
to other systems or worry about different .so versions causing a problem. How do I do this?
if i am given only a .so file, can static linking be done with it?
i also don't want to static link anything else, just this one libtdfdll.so
file