您的位置:首页 > 编程语言 > C语言/C++

安装opencv出现:cudalegacy/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared

2017-08-10 17:30 846 查看
原文链接:http://blog.csdn.NET/allyli0022/article/details/62859290

/home/usrname/OpenCV-3.0.0/modules/cudalegacy/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’
has not been declared
     typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppStat
                                                      ^
/home/usrname/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp:135:18: error: ‘NppiGraphcutState’ does not name a type
         operator NppiGraphcutState*()
                  ^
/home/usrname/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp:141:9: error: ‘NppiGraphcutState’ does not name a type
         NppiGraphcutState* pState;

解决方案:需要修改一处源码:
在graphcuts.cpp中将

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

改为

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: