Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Combining multiple static libraries in opencv to single shared library

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 underachieving .a files to .o files and create opencv.so from object files. Seems it almost works, but it gives few errors saying

undefined reference toicvCvt_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++

Combining multiple static libraries in opencv to single shared library

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 underachieving .a files to .o files and create opencv.so from object files. Seems it almost works, but it gives few errors saying

undefined  `undefined reference toicvCvt_BGRA2RGBA_16u_C4R(unsigned to `icvCvt_BGRA2RGBA_16u_C4R(unsigned short const, const*, int, unsigned short, short*, int, CvSize)'`, 

CvSize)'`,

which are bit strange errors. Please help. Note: I am compiling using arm-g++

Combining multiple static libraries in opencv to single shared library

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 underachieving 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++