I am trying to executing the OpenCV sample c++ program but i am getting error ''undefined reference to `compress'''.
I have cross compiled Opencv library statically for riscv architecture.Now I am going to executing opencv c++ sample program.I made Makefile and i am executing make.
Makefile :-
CXX =riscv64-unknown-linux-gnu-g++
CXXFLAGS += -c -Wall $(shell pkg-config --cflags /home/billa/Downloads/opencv-3.4.2/platforms/linux/riscv_build/install/lib/pkgconfig/opencv.pc)
LDFLAGS += $(shell pkg-config --libs --static /home/billa/Downloads/opencv-3.4.2/platforms/linux/riscv_build/install/lib/pkgconfig/opencv.pc)
all: opencv_example
opencv_example: example.o; $(CXX) $< -o $@ $(LDFLAGS)
%.o: %.cpp; $(CXX) $< -o $@ $(CXXFLAGS)
clean: ; rm -f example.o opencv_example
Error :-
/home/billa/Downloads/opencv-3.4.2/platforms/linux/riscv_build/install/share/OpenCV/3rdparty/lib/libIlmImf.a(ImfZipCompressor.cpp.o): In function `.L0 ':
ImfZipCompressor.cpp:(.text._ZN3Imf13ZipCompressor8compressEPKciiRS2_+0xc6): undefined reference to `compress'
ImfZipCompressor.cpp:(.text._ZN3Imf13ZipCompressor10uncompressEPKciiRS2_+0x28): undefined reference to `uncompress'
/home/billa/Downloads/opencv-3.4.2/platforms/linux/riscv_build/install/share/OpenCV/3rdparty/lib/libIlmImf.a(ImfPxr24Compressor.cpp.o): In function `.L0 ':
ImfPxr24Compressor.cpp:(.text._ZN3Imf15Pxr24Compressor8compressEPKciN5Imath3BoxINS3_4Vec2IiEEEERS2_.part.3+0x1d4): undefined reference to `compress'
ImfPxr24Compressor.cpp:(.text._ZN3Imf15Pxr24Compressor10uncompressEPKciN5Imath3BoxINS3_4Vec2IiEEEERS2_.part.4+0x34): undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target 'opencv_example' failed
make: *** [opencv_example] Error 1
Please help me in this
Thanks in advance
maybe you should go back, and disable the exr codecs , when building the opencv libs, like
cmake -DWITH_OPENEXR=OFF -DBUILD_OPENEXR=OFF
(since those have a ton of weird dependancies, and your pkg-config did not get this straight)