【有偿求助200¥解决c++编译报错问题】【求帮忙】海思平台移植opencv编译错误

easy2ubuntu 发布于 2016/05/09 12:46
阅读 566
收藏 0

运行环境:Ubuntu15.04

当前目录:

whatsrobot@whatsrobot-VirtualBox:~/share/opencv/canny$ ls
1.jpg  lib             main-canny.o  noe.jpg  opencv2            QQ图片20160507200048.png  stand-s.jpg
2.jpg  main-canny.cpp  makefile      opencv   P60503-144827.jpg  stand.jpg                 tt8.jpg

makefile代码:

CC:= arm-hisiv100-linux-g++
INCLUDE := -I/home/whatsrobot/share/opencv/canny/
LDFLAGS = -L./lib
LDLIBS =  -lopencv_superres -lopencv_objdetect -lopencv_imgcodecs -lopencv_video  -lopencv_shape  \
          -lopencv_highgui  -lopencv_core  -lopencv_ml -lopencv_flann -lopencv_features2d  -lopencv_calib3d\
          -lopencv_imgproc    -lopencv_photo     -lopencv_videoio\


CFLAGS := -Wall -g -Wl,-gc-sections -march=armv7-a

# target source
SRC  := $(wildcard *.cpp) 
OBJ  := $(SRC:%.cpp=%.o)

TARGET := main
.PHONY : clean all

all: $(TARGET)


$(TARGET):$(OBJ)
	$(CC)  -o $@ $^ $(LDFLAGS) $(LDLIBS)  $(CFLAGS) -lpthread -lm 

$(OBJ):
	$(CC) $(CFLAGS) $(INCLUDE) $(LIBS) -c $(SRC)

clean:
	rm -f $(TARGET)
	rm -f $(OBJ)
编译出现错误:
whatsrobot@whatsrobot-VirtualBox:~/share/opencv/canny$ make;
arm-hisiv100-linux-g++  -o main main-canny.o -L./lib -lopencv_superres -lopencv_objdetect -lopencv_imgcodecs -lopencv_video  -lopencv_shape -lopencv_highgui  -lopencv_core  -lopencv_ml -lopencv_flann -lopencv_features2d  -lopencv_calib3d -lopencv_imgproc    -lopencv_photo     -lopencv_videoio   -Wall -g -Wl,-gc-sections -march=armv7-a -lpthread -lm 
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_video.so, needed by ./lib/libopencv_superres.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_videoio.so, needed by ./lib/libopencv_superres.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_imgcodecs.so, needed by ./lib/libopencv_superres.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_imgproc.so, needed by ./lib/libopencv_superres.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_core.so, needed by ./lib/libopencv_superres.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_ml.so, needed by ./lib/libopencv_objdetect.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_highgui.so, needed by ./lib/libopencv_objdetect.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_flann.so, needed by ./lib/libopencv_features2d.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_features2d.so, needed by ./lib/libopencv_calib3d.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: main: hidden symbol `__sync_fetch_and_add_4' in /opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/libgcc.a(linux-atomic.o) is referenced by DSO
/opt/hisi-linux/x86-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
makefile:22: recipe for target 'main' failed
make: *** [main] Error 1

加载中
返回顶部
顶部