兵马逐浪去,将象入海流。炮声震心动,惊起卧龙游。
我的博客园主页 --------- 我的知乎主页 --------- 我的github主页 --------- 我的csdn主页 --------- 我的新浪微博

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

 /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较早,要编译通过需要修改源码:


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

将  

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

改为  

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

重新编译即可。


posted @ 2020-09-16 22:22  leoking01  阅读(217)  评论(0编辑  收藏  举报
#back-to-top { background-color: #00CD00; bottom: 0; box-shadow: 0 0 6px #00CD00; color: #444444; padding: 10px 10px; position: fixed; right: 50px; cursor: pointer; }