Ubuntu中安装openCV时Cmake问题解决

1、执行Cmake的语句指令

sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

2、当执行完上述指令后遇见以下问题解决策略

问题1:

CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else):
  Flow control statements are not properly nested.
Call Stack (most recent call first):
  CMakeLists.txt:495 (include)

 解决方法:

将openCV文件夹中的cmake/OpenCVCompilerOptions.cmake打开,将其中的21~22注释掉,21行的else()与前面的else()重复所导致。如下图所示:

问题2

CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
  file DOWNLOAD HASH mismatch

 解决方法:

执行以下指令便可解决问题2:

sudo cmake -D WITH_IPP=OFF CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

以上两个问题便是在openCV在安装过程中Cmake所会出现的问题。

猜你喜欢

转载自blog.csdn.net/qq_57061492/article/details/126171010