问题1:opencv-2.4.10/modules/gpu/src/nvidia/core/NCV.cu(356): error : namespace "std" has no member "max"
解决办法:It seems as though you need to add #include <algorithm>
for this to work (as suggested here).
参考链接:https://stackoverflow.com/questions/27585586/installing-opencv-2-4-10-on-windows-8-1-with-vs-2013
问题2:tuple(328): error C2610: “std::tuple<cv::Size,perf::`anonymous-namespace'::MatDepth,perf
解决办法:cmake-gui取消BUILD_PERF_TESTS
参考博客:https://blog.csdn.net/qq_17127427/article/details/82697048
问题3:graphcuts.cpp(120): error C2061: 语法错误: 标识符“NppiGraphcutState”
解决办法:
需要修改一处源码:
在graphcuts.cpp中将
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) 改为
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
参考博客:https://blog.csdn.net/andkobe/article/details/78145741
或参考这里:https://answers.opencv.org/question/95148/cudalegacy-not-compile-nppigraphcut-missing/
问题4:nvcc fatal : Unsupported gpu architecture 'compute_11'
解决办法:CUDA_GENERATION=Kepler
参考博客:https://www.cnblogs.com/sopic/p/6680799.html
问题5:CMake Error at cuda_compile_generated_matrix_operations.cu.obj.cmake:206 (message):
解决办法:CUDA_GENERATION=Kepler
问题6:modulescoreCMakeFilescuda_compile.dir\__dynamicudasrccudaDebugcuda_compile_generated_matrix_operations.cu.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
解决办法:找到这个文件,将“-m32"改为”-m64“,重新编译。
参考这里的cmake文件可知,opencv2.4.10支持cuda2.3及更低版本的cuda。
opencv2.4.10不适合配置cuda8.0一起编译,需要用更高版本的opencv和cuda8.0一起编译,否则会遇到各种难以解决的问题。
如果在使用cmake-gui配置时取消 WITH_CUDA的勾选,就不会遇到上面的这些错误,而且一遍通过。