make -j6//(run 6 jobs in parallel,但最好不要超过cpu核数,不然可能会出现错误) 注:本人在make时会遇到C++内部错误,不用管它,再次make可继续编译,具体原因不知
sudo make install
在执行imshow函数时,出现如下error OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/nvidia/Documents/opencv-3.4.0/modules/highgui/src/window.cpp, line 611 terminate called after throwing an instance of cv::Exception 解决方法:在cmake时加入-D WITH_QT=ON 选项
在-D WITH_QT=ON 编译时,出现如下error error: #error Please include the appropriate gl headers before including cuda_gl_interop.h 解决办法:修改文件/usr/local/cuda-8.0/targets/aarch64-linux/include/cuda_gl_interop.h如下,注释掉第8-12及第14行即可
7.#else /* __APPLE__ */
8.//#if defined(__arm__) || defined(__aarch64__)
9.//#ifndef GL_VERSION
10.//#error Please include the appropriate gl headers before including cuda_gl_interop.h
11.//#endif
12.//#else
13.#include <GL/gl.h>
14.//#endif
15.#endif /* __APPLE__ */
读取视频时,出现error Unable to stop the stream: Inappropriate ioctl for device 解决方法:安装ffmpeg sudo apt-get install ffmpeg sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev 注:必须要装才行 在cmake时能看到如下显示,则说明cmake使用ffmpeg编译成功
error:calling a constexpr __host__ function("abs") from a __device__ function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this. 解方法:添加编译选项-D CUDA_NVCC_FLAGS=--expt-relaxed-constexpr
error:libopencv_imgcodecs.so.3.4.5: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0 解决方法:sudo apt install libtiff-dev
undefined reference to cv::softdouble::operator 解决办法:这是由于链接库顺序的问题,将libopencv_core.so放到最后
undefined reference to __itt_metadata_add_ptr__3_0 解决方法:链接上3rdparty/lib/libittnotify库
undefined reference to cvRemap undefined reference to cvInitUndistortRectifyMap undefined reference to cvConvertMaps 解决办法:在cmake 时添加-DWITH_1394=OFF编译选项