opencv的应用程序 交叉编译出现警告:找不到动态链接库,但make可以生成执行文件,并在arm板上正常运行

asdas12eqe 2015-06-18 12:33:07
在pc端交叉编译了一个视频采集程序,写了一个Makefile:
LIBS = $(shell pkg-config --libs opencv) -lpthread -lrt
SOURCES = cap.cpp
OBJECTS = $(SOURCES:.cpp=.o)
TARGET = cap
$(TARGET):$(OBJECTS)
arm-linux-g++ -o $@ $^ $(LIBS)
clean:
rm $(OBJECTS) $(TARGET)
%.o:%.cpp
arm-linux-g++ -o $@ -c $<

make:出现警告:
/opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_core.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link)
/opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_flann.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link)
/opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_imgproc.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link)

但我已经把opencv目录下的include和lib库都复制到交叉编译器指定的目录下。
make最后生成的执行文件也可以在树莓派上执行。
请问怎么消除这些警告?
...全文
1046 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jamon_tan 2017-09-12
  • 打赏
  • 举报
回复
你的Makefile没有指定加载的opencv动态库
幽饮烛 2017-08-11
  • 打赏
  • 举报
回复
libopencv_calib3d.so 是 arm eabi 版本吗?
Faustine___ 2017-08-08
  • 打赏
  • 举报
回复
引用 2 楼 lishuang1224 的回复:
我的没这些警告,但是在板子上跑不起来,,,
兄弟,你跑起来了吗
Milk_1997 2017-08-08
  • 打赏
  • 举报
回复
你可以尝试一下静态编译呢?
jklinux 2017-08-08
  • 打赏
  • 举报
回复
引用 楼主 you19890102 的回复:
在pc端交叉编译了一个视频采集程序,写了一个Makefile: LIBS = $(shell pkg-config --libs opencv) -lpthread -lrt SOURCES = cap.cpp OBJECTS = $(SOURCES:.cpp=.o) TARGET = cap $(TARGET):$(OBJECTS) arm-linux-g++ -o $@ $^ $(LIBS) clean: rm $(OBJECTS) $(TARGET) %.o:%.cpp arm-linux-g++ -o $@ -c $< make:出现警告: /opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_core.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link) /opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_flann.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link) /opt/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: ../../lib/libopencv_imgproc.so, needed by /usr/local/lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link) 但我已经把opencv目录下的include和lib库都复制到交叉编译器指定的目录下。 make最后生成的执行文件也可以在树莓派上执行。 请问怎么消除这些警告?
有可能是这些动态库编译时用的编译器与你现在的编译器版本不一。 也有可能是库之间的版本依赖问题, 即一些库也需要调用另一些库,但那库的版本太低了
lishuang1224 2017-07-11
  • 打赏
  • 举报
回复
我的没这些警告,但是在板子上跑不起来,,,
张嫩嫩 2016-07-28
  • 打赏
  • 举报
回复
楼主解决了吗?我也遇到这个问题了

23,124

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧