Ask Your Question
0

I am trying to executing the OpenCV sample c++ program but i am getting error ''undefined reference to `compress'''.

asked 2018-07-20 00:45:02 -0600

updated 2018-07-20 01:41:17 -0600

berak gravatar image

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

edit retag flag offensive close merge delete

Comments

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)

berak gravatar imageberak ( 2018-07-20 01:45:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-20 06:59:06 -0600

Thanks.. after adding cmake -DWITH_OPENEXR=OFF -DBUILD_OPENEXR=OFF it is working fine.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-07-20 00:45:02 -0600

Seen: 1,169 times

Last updated: Jul 20 '18