编译opencv3.1.0时出现错误: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较早,要编译通过需要修改源码:
修改/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)
重新编译即可。
_________________________________________________________________________________________________________________________________________________
每一个不曾起舞的日子,都是对生命的辜负。
But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采
每一个不曾起舞的日子,都是对生命的辜负。
But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采