编译opencv2.4.11时出现错误:error: ‘NppiGraphcutState’ has not been declared

安装cuda以后再安装opencv时出现错误:
 /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared  
      typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppStat ^ /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:135:18: error: ‘NppiGraphcutState’ does not name a type operator NppiGraphcutState*() ^ /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:141:9: error: ‘NppiGraphcutState’ does not name a type NppiGraphcutState* pState; 


cuda8.0较新,opencv-2.4.11较早,要编译经过须要修改源码:spa


修改/data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp源码

将  it

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)   编译

改成  opencv

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000) class

从新编译便可。module