tx2 opencv ubuntu16.04 问题总结

 
  

 1.交叉编译opencv3.2.0后连接出现:

libopencv_imgcodecs.so: undefined reference to `png_init_filter_functions_neon'

进入到3rdparty/libpng,在CMakeLists.txt最顶端增加:

set(ENABLE_NEON ON)

2.error: ‘NppiGraphcutState’ does not name a type
         NppiGraphcutState* pState;
解决方案:需要修改一处源码:
在graphcuts.cpp中将
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
改为
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
3.VIDEOIOERROR: V4L/V4L2: 
缺少依赖,安装一下依赖,重装opencv,重装时只需cmake后续步骤,不用卸载。
apt-getinstall libv4l-0 libv4l-dev
参考链接:
http://blog.sina.com.cn/s/blog_96b836170102was7.html

4.file not recognized: File truncated
sample.o: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[5]: *** [libsample.so] Error 1
make[4]: *** [toolkit/library/target] Error 2
解决方法: make clean
然后执行: make

5.ccache 编译加速,参考一下链接
http://blog.csdn.net/snailjava/article/details/1647813
https://www.cnblogs.com/jason2013/articles/4675468.html

6.opencv安装前一定先安装好各种需要的依赖包,然后安装opencv.
如果后安了依赖库,需重新安装opencv,只需cmake make make install等。
用ccache貌似可以加速make等编译。

你可能感兴趣的:(tx2 opencv ubuntu16.04 问题总结)