先提示产生libopencv_dnn.so出错。反复删除、编译都不对。

  后来注意到,前面已经出错了,错误是:

libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against 符号 `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC

 

  经过上网,有人说,是因为ffmpeg编译有问题。使用如下方法:

./configure --disable-asm --disable-x86asm --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include  --extra-cflags=-fPIC –extra-ldflags=-L/usr/local/cuda/lib64
# --enable-shared --enable-pic 
	make clean
	make -j8
	sudo make install

或者:

make -j CFLAGS=-fPIC