opencv的应用程序 交叉编译出现警告:找不到动态链接库,但make可以生成执行文件,并在arm板上正常运行
在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最后生成的执行文件也可以在树莓派上执行。
请问怎么消除这些警告?