opencv海思平台移植解决warning: ../../lib/libopencv_imgproc.so, needed by ../lib/libopencv_imgcodecs.so, not

本文介绍了在海思平台上移植OpenCV时遇到的warning问题,即动态库路径问题,以及如何消除这个警告。通过将库放在工程上两级目录并修改makefile中的库路径,成功解决编译警告。同时,测试了opencv-2.4.9和opencv-3.4.2在不同平台上的情况,发现opencv-2.4.9在3516a平台存在执行时符号解析错误,目前问题尚未解决。

1、opencv编译部分请参考:

https://blog.youkuaiyun.com/qq_39660930/article/details/78050030

2、编译过程中出现的错误查找网络自行解决;

编译过程中出现的错误因人而异,我遇到的错误是cuda和protobuf,关闭这两个编译选项即可。

3、交叉编译过程中出现:

warning: ../../lib/libopencv_imgproc.so, needed by ../lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)

是因为编译后的opencv动态库自带路径[ ../../lib/libopencv_imgproc.so];

使用命令查看:readelf -d libopencv_imgproc.so | grep NEEDED

 0x00000001 (NEEDED)                     共享库:[../../lib/libopencv_core.so]
 0x00000001 (NEEDED)                     共享库:[libstdc++.so.6]
 0x00000001 (NEEDED)                     共享库:[libm.so.0]
 0x00000001 (NEEDED)                    

/usr/bin/ld: warning: libIlmImf-2_3.so.24, needed by ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7, not found (try using -rpath or -rpath-link) /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::InputFile::InputFile(char const*, int)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::OutputFile::setFrameBuffer(Imf_2_3::FrameBuffer const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::FrameBuffer::insert(char const*, Imf_2_3::Slice const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Header::channels()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::chromaticities(Imf_2_3::Header const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::OutputFile::OutputFile(char const*, Imf_2_3::Header const&, int)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::FrameBuffer::begin()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Header::Header(int, int, float, Imath_2_3::Vec2<float> const&, float, Imf_2_3::LineOrder, Imf_2_3::Compression)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Channel::Channel(Imf_2_3::PixelType, int, int, bool)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Header::channels() const' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::InputFile::setFrameBuffer(Imf_2_3::FrameBuffer const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::FrameBuffer::end()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::InputFile::header() const' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Header::~Header()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::InputFile::readPixels(int, int)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::globalThreadCount()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Header::dataWindow() const' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::ChannelList::findChannel(char const*) const' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::OutputFile::~OutputFile()' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Slice::Slice(Imf_2_3::PixelType, char*, unsigned long, unsigned long, int, int, double, bool, bool)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::Chromaticities::Chromaticities(Imath_2_3::Vec2<float> const&, Imath_2_3::Vec2<float> const&, Imath_2_3::Vec2<float> const&, Imath_2_3::Vec2<float> const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::OutputFile::writePixels(int)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::ChannelList::insert(char const*, Imf_2_3::Channel const&)' /usr/bin/ld: ../third_party/opencv3/lib64/libopencv_imgcodecs.so.3.4.7: undefined reference to `Imf_2_3::hasChromaticities(Imf_2_3::Header const&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/ppocr.dir/build.make:320: ppocr] Error 1 make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/ppocr.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 怎么解决
最新发布
11-27
评论 9
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值