CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else):

CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else):
  A duplicate ELSE command was found inside an IF block.
Call Stack (most recent call first):
  CMakeLists.txt:495 (include)

这种问题很简单了,直接打开cmake/OpenCVCompilerOptions.cmake:21 ,找到21行,他就是多了一行多余的endif,直接删除掉就好了

  • 16
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
引用\[1\]: CMake Error at cmake/OpenCVUtils.cmake:1043 (file): file DOWNLOAD HASH mismatch for file: \[F:/build-opencv3.2.0/opencv_contrib-3.2.0/modules/xfeatures2d/cmake/.download/7126a5d9a8884ebca5aea5d63d677225/vgg_generated_64.i\] expected hash: \[7126a5d9a8884ebca5aea5d63d677225\] actual hash: \[d41d8cd98f00b204e9800998ecf8427e\] status: \[6;"Couldn't resolve host name"\] 引用\[2\]:打开文件:F:\build-opencv3.2.0\opencv-3.2.0\cmake\OpenCVCompilerOptions.cmake 看下第21行 我去,这是谁写的,怎么同一个if下有两个else呢 直接把第二个else去掉吧,即把第21行第22行注释掉吧。 继续configure,依然是缺那几个文件: Downloading opencv_ffmpeg.dll... CMake Error at cmake/OpenCVUtils.cmake:1043 (file): file DOWNLOAD HASH mismatch for file: \[F:/build-opencv3.2.0/opencv-3.2.0/3rdparty/ffmpeg/downloads/f081abd9d6ca7e425d340ce586f9c090/opencv_ffmpeg.dll\] expected hash: \[f081abd9d6ca7e425d340ce586f9c090\] actual hash: \[d41d8cd98f00b204e9800998ecf8427e\] status: \[6;"Couldn't resolve host name"\] Call Stack (most recent call first): 3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download) cmake/OpenCVFindLibsVideo.cmake:219 (include) CMakeLists.txt:557 (include) CMake Error at cmake/OpenCVUtils.cmake:1047 (message): Failed to download opencv_ffmpeg.dll. Status=6;"Couldn't resolve host name" Call Stack (most recent call first): 3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download) cmake/OpenCVFindLibsVideo.cmake:219 (include) CMakeLists.txt:557 (include) 引用\[3\]:下载完成后,创建相关目录并解压。 打开Cmake,然后按下面的截图操作: 很快报错,报错如下: 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) 问题: .cmake文件的pwd 回答: 你提到的".cmake"文件的pwd是指当前工作目录。在这个上下文中,".cmake"文件的pwd是指该文件所在的目录路径。 #### 引用[.reference_title] - *1* *2* *3* [利用CMake生成OpenCV-3.2.0的VS2013工程(解决方案)的失败过程记录...](https://blog.csdn.net/wenhao_ir/article/details/125103083)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值