已有opencv3.4.2安装opencv2.4.9

1.

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D CMAKE_INSTALL_PREFIX=/usr/local/opencv249 ..

make (-j12)

报错:

1.

解决方法:cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D CMAKE_INSTALL_PREFIX=/usr/local/opencv249 -D CUDA_GENERATION=Kepler ..

2.

31 errors detected in the compilation of "/tmp/tmpxft_000089dc_00000000-9_NCVPyramid.compute_35.cpp1.ii".
CMake Error at cuda_compile_generated_NCVPyramid.cu.o.cmake:266 (message):
  Error generating file
  /home/wang/software/opencv-2.4.9/build/modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/./cuda_compile_generated_NCVPyramid.cu.o


modules/gpu/CMakeFiles/opencv_gpu.dir/build.make:16624: recipe for target 'modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/cuda_compile_generated_NCVPyramid.cu.o' failed
make[2]: *** [modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/cuda_compile_generated_NCVPyramid.cu.o] Error 1
make[2]: *** 正在等待未完成的任务....

链接:http://pan.baidu.com/s/1c2DOFDY 密码:rohl   替换

opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp文件

或者将所有的 template <> static 去掉static

3.

/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared
     typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppState, Npp8u* pDeviceMem);
                                                      ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:135:18: error: ‘NppiGraphcutState’ does not name a type
         operator NppiGraphcutState*()
                  ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:141:9: error: ‘NppiGraphcutState’ does not name a type
         NppiGraphcutState* pState;
         ^
In file included from /home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/internal_shared.hpp:50:0,
                 from /home/wang/software/opencv-2.4.9/build/modules/gpu/precomp.hpp:106:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp: In constructor ‘{anonymous}::NppiGraphcutStateHandler::NppiGraphcutStateHandler(NppiSize, Npp8u*, {anonymous}::init_func_t)’:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:127:39: error: ‘pState’ was not declared in this scope
             nppSafeCall( func(sznpp, &pState, pDeviceMem) );
                                       ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp: In destructor ‘{anonymous}::NppiGraphcutStateHandler::~NppiGraphcutStateHandler()’:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:132:43: error: ‘pState’ was not declared in this scope
             nppSafeCall( nppiGraphcutFree(pState) );
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:132:49: error: ‘nppiGraphcutFree’ was not declared in this scope
             nppSafeCall( nppiGraphcutFree(pState) );
                                                 ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp: In function ‘void cv::gpu::graphcut(cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::Stream&)’:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:174:51: error: ‘nppiGraphcutGetSize’ was not declared in this scope
     nppSafeCall( nppiGraphcutGetSize(sznpp, &bufsz) );
                                                   ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:182:61: error: ‘nppiGraphcutInitAlloc’ was not declared in this scope
     NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcutInitAlloc);
                                                             ^
In file included from /home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/internal_shared.hpp:50:0,
                 from /home/wang/software/opencv-2.4.9/build/modules/gpu/precomp.hpp:106:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:191:146: error: ‘nppiGraphcut_32s8u’ was not declared in this scope
             static_cast<int>(terminals.step), static_cast<int>(leftTransp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) );
                                                                                                                                                  ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:196:146: error: ‘nppiGraphcut_32f8u’ was not declared in this scope
             static_cast<int>(terminals.step), static_cast<int>(leftTransp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) );
                                                                                                                                                  ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp: In function ‘void cv::gpu::graphcut(cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::GpuMat&, cv::gpu::Stream&)’:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:246:52: error: ‘nppiGraphcut8GetSize’ was not declared in this scope
     nppSafeCall( nppiGraphcut8GetSize(sznpp, &bufsz) );
                                                    ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:254:61: error: ‘nppiGraphcut8InitAlloc’ was not declared in this scope
     NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcut8InitAlloc);
                                                             ^
In file included from /home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/internal_shared.hpp:50:0,
                 from /home/wang/software/opencv-2.4.9/build/modules/gpu/precomp.hpp:106:
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:267:146: error: ‘nppiGraphcut8_32s8u’ was not declared in this scope
             static_cast<int>(terminals.step), static_cast<int>(leftTransp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) );
                                                                                                                                                  ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/graphcuts.cpp:274:146: error: ‘nppiGraphcut8_32f8u’ was not declared in this scope
             static_cast<int>(terminals.step), static_cast<int>(leftTransp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) );
                                                                                                                                                  ^
/home/wang/software/opencv-2.4.9/modules/gpu/src/cuda/safe_call.hpp:84:43: note: in definition of macro ‘nppSafeCall’
 #define nppSafeCall(expr)  ___nppSafeCall(expr, __FILE__, __LINE__, CV_Func)
                                           ^

解决方案:
在graphcuts.cpp中

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

改成

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

4.

/home/wang/software/opencv-2.4.9/modules/contrib/src/rgbdodometry.cpp:65:47: fatal error: unsupported/Eigen/MatrixFunctions: 没有那个文件或目录
compilation terminated.

解决方法:将rgbdodometry.cpp中包含eigen的部分改为绝对路径

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值