zxing-cpp icon indicating copy to clipboard operation
zxing-cpp copied to clipboard

Fails to build shared libs

Open yurivict opened this issue 6 years ago • 3 comments

Getting these errors:

[1/1] : && /usr/bin/c++  -O2 -pipe -fno-omit-frame-pointer -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -DLIBICONV_PLUG -O2 -pipe -fno-omit-frame-pointer -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -DLIBICONV_PLUG  -fstack-protector CMakeFiles/zxing.dir/cli/src/ImageReaderSource.cpp.o CMakeFiles/zxing.dir/cli/src/jpgd.cpp.o CMakeFiles/zxing.dir/cli/src/lodepng.cpp.o CMakeFiles/zxing.dir/cli/src/main.cpp.o  -o zxing  -Wl,-rpath,/usr/ports/textproc/zxing-cpp/work/.build: libzxing.so -lc && :
FAILED: zxing 
: && /usr/bin/c++  -O2 -pipe -fno-omit-frame-pointer -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -DLIBICONV_PLUG -O2 -pipe -fno-omit-frame-pointer -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -DLIBICONV_PLUG  -fstack-protector CMakeFiles/zxing.dir/cli/src/ImageReaderSource.cpp.o CMakeFiles/zxing.dir/cli/src/jpgd.cpp.o CMakeFiles/zxing.dir/cli/src/lodepng.cpp.o CMakeFiles/zxing.dir/cli/src/main.cpp.o  -o zxing  -Wl,-rpath,/usr/ports/textproc/zxing-cpp/work/.build: libzxing.so -lc && :
libzxing.so: undefined reference to `cv::Mat::deallocate()'
libzxing.so: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
libzxing.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
libzxing.so: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
libzxing.so: undefined reference to `cv::fastFree(void*)'

yurivict avatar Mar 11 '18 07:03 yurivict

call 'pkg-config opencv --cflags --libs' to check opencv path, and add -lopencv_core -lopencv_imgproc -lopencv_highgui to link script.

bygreencn avatar Mar 29 '18 09:03 bygreencn

This is a bug that it doesn't use ${OpenCV_LIBRARIES} to link zxing in this line: https://github.com/glassechidna/zxing-cpp/blob/master/CMakeLists.txt#L86

yurivict avatar Jul 09 '18 07:07 yurivict

@tm-drtina Could you please fix CMakeLists.txt?

yurivict avatar Jul 09 '18 08:07 yurivict