编译OpenCV:precomp.hpp:60:37: fatal error: dynlink_nvcuvid.h

简介: 编译OpenCV:precomp.hpp:60:37: fatal error: dynlink_nvcuvid.h

原因:CUDA有一些接口过期了。

解决办法:

cmake增加选项:-D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" -D BUILD_opencv_cudacodec=ON

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=on \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D WITH_NVCUVID=on \
-D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" -D BUILD_opencv_cudacodec=ON \
-D CUDA_GENERATION=Auto -D WITH_OPENCL=OFF -D WITH_OPENCL_SVM=off \
-D WITH_OPENCLAMDFFT=off -D WITH_OPENCLAMDBLAS=off \
-D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D ENABLE_CXX11=1 \
-D WITH_FFMPEG=ON \
-D FFMPEG_LIBRARY_DIRS="/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/local/cuda-10.0/lib64;/usr/local/include/ffnvcodec" \
-D PYTHON2_NUMPY_INCLUDE_DIRS="/usr/local/lib/python2.7/dist-packages/numpy/core/include" \
-D PYTHON3_NUMPY_INCLUDE_DIRS="/usr/local/lib/python3.5/site-packages/numpy/core/include" \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.5/modules \
  ..

有一次莫名其妙的编译过了,重新编译……不过。

 

有人建议:

下载video_sdk。

然后复制头文件/usr/local/cuda/include/

修改modules/cudacodec/src下的hpp文件,如下:

#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000 
    #include <dynlink_nvcuvid.h>
#else
    #include <nvcuvid.h>
#endif

看这意思,是改回去了?

目录
相关文章
|
开发工具 git
MAC编译OpenJDK8:clang: error: include path for libstdc++ headers not found(独家解决办法)
MAC编译OpenJDK8:clang: error: include path for libstdc++ headers not found(独家解决办法)
126 0
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
230 0
|
数据安全/隐私保护
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
|
并行计算 计算机视觉
编译OpenCV:precomp.hpp:60:37: fatal error: dynlink_nvcuvid.h
编译OpenCV:precomp.hpp:60:37: fatal error: dynlink_nvcuvid.h
134 0
编译Ffmpeg错误:strsafe.h:1859:11: error: ‘WEOF‘ undeclared
编译Ffmpeg错误:strsafe.h:1859:11: error: ‘WEOF‘ undeclared
106 0
编译OpenJDK12:globalDefinitions_visCPP.hpp(46): fatal error C1083:inttypes.h No such file or directory
编译OpenJDK12:globalDefinitions_visCPP.hpp(46): fatal error C1083:inttypes.h No such file or directory
122 0
|
计算机视觉 Python
编译OpenCV:cv2.cpp:23:33: fatal error: numpy/ndarrayobject.h: 没有那个文件或目录
编译OpenCV:cv2.cpp:23:33: fatal error: numpy/ndarrayobject.h: 没有那个文件或目录
94 0
|
并行计算 C++
错误解决:src/cpp/cuda.hpp:  fatal error: cuda.h
错误解决:src/cpp/cuda.hpp:  fatal error: cuda.h
124 0
编译OpenJDK8:NMAKE : fatal error U1077
编译OpenJDK8:NMAKE : fatal error U1077
142 0
编译OpenJDK12:atomic.hpp: fatal error C1189: size_t is not WORD_SIZE(换了VS2017编译)
编译OpenJDK12:atomic.hpp: fatal error C1189: size_t is not WORD_SIZE(换了VS2017编译)
104 0