Combining multiple static libraries in opencv to single shared library [closed]
Is there any way we can combine multiple static libraries (.a) files like libopencv_core.a libopencv_imgproc.a etc in to single .so file like libopencv.so?
I tried to combine using this command,
arm-linux-g++ -D_REENTRANT -fPIC -shared -o ./(OUT_DLL) -L/localpath/to/opencv/lib/ -lopencv_features2d -lopencv_flann -lopencv_objdetect -lm -lopencv_ml -lopencv_highgui -lopencv_imgproc -lopencv_core -L/localpath/to/3rdparty/lib/ -llibjpeg -llibtiff -lzlib -llibjasper -llibpng -lpthread -lrt -lIlmImf
to creare libopencv.so. But when I am creating an application with this .so file it gives error saying undefined reference to cv:Mat etc., which suggest my .so file doesnt contain the symbols from .a files.
I also tried un-archiving .a files to .o files and create opencv.so from object files. Seems it almost works, but it gives few errors saying
`undefined reference to `icvCvt_BGRA2RGBA_16u_C4R(unsigned short const*, int, unsigned short*, int, CvSize)'`,
which are bit strange errors. Please help. Note: I am compiling using arm-g++
There is something called "version script" that may be useful. Since I am not a GCC user, I cannot offer any specific advice. Links: https://gcc.gnu.org/ml/gcc-help/2010-10/msg00117.html , http://sourceware.org/binutils/docs-2.20/ld/VERSION.html , https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html , http://stackoverflow.com/questions/792195/gnu-linker-alternative-to-version-script-to-list-exported-symbols-at-the-comm