Ask Your Question

Revision history [back]

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 tocompress' 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 touncompress' 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

click to hide/show revision 2
None

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

berak gravatar image

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 

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 `.L0 ':
ImfZipCompressor.cpp:(.text._ZN3Imf13ZipCompressor8compressEPKciiRS2_+0xc6): undefined reference tocompress'
to `compress'
ImfZipCompressor.cpp:(.text._ZN3Imf13ZipCompressor10uncompressEPKciiRS2_+0x28): undefined reference to uncompress'
`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 function `.L0 ':
ImfPxr24Compressor.cpp:(.text._ZN3Imf15Pxr24Compressor8compressEPKciN5Imath3BoxINS3_4Vec2IiEEEERS2_.part.3+0x1d4): undefined reference to compress'
`compress'
ImfPxr24Compressor.cpp:(.text._ZN3Imf15Pxr24Compressor10uncompressEPKciN5Imath3BoxINS3_4Vec2IiEEEERS2_.part.4+0x34): undefined reference touncompress'
to `uncompress'
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target 'opencv_example' failed
make: * *** [opencv_example] Error 1

1

Please help me in this

Thanks in advance