【003】cmake安装更新(解决cmake报错:CMake 3.8 or higher is required. You are running version 3.5.1)

ubuntu16.04在安装libfreenect过程中,出现cmake报错:CMake 3.8 or higher is required. You are running version 3.5.1
cmake3.5.1是在安装ubuntu系统时安装的默认版本,需要自行下载cmake更高版本进行安装。

  1. 查看当前版本
cmake --version
  1. 卸载cmake(安装ros时可跳过)
sudo apt remove cmake

注:再此步骤中,由于我安装了ros系统,提示会卸载许多与ros相关的cmake文件,可能会导致ros无法使用,所以跳过此步。

  1. 下载更高版本cmake,可在cmake官网下载,我下载的是cmake-3.16.8.tar.gz

  2. 安装cmake

  • 将cmake-3.16.8.tar.gz解压并提取出来

  • 由于安装了ros跳过了第二步,所以先找到cmake路径,将原来版本的cmake执行文件删除

which cmake
cd /usr/bin/
sudo rm cmake
  • 将cmake-3.16.8.tar.gz提取出来并安装
cd cmake-3.16.8
./configure
make
sudo make install
cmake --version
  • 安装成功后显示如下
    在这里插入图片描述

可能出现的错误及解决方案:

错误1: 在./configure时出现报错:

Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.

提示找不到make。

  • 解决方案:
sudo apt-get install make

继续运行其他安装步骤

错误2: 在./configure时出现报错:

CMake Error at Utilities/cmcurl/CMakeLists.txt:454 (message):
  Could not find OpenSSL.  Install an OpenSSL development package or
  configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
  
Error when bootstrapping CMake:
Problem while running initial CMake

提示找不到OpenSSL,查看错误日志,缺少软件包。

  • 解决方案:
sudo apt-get install libssl-dev

继续运行其他安装步骤

参考链接:
https://blog.csdn.net/qq_35398033/article/details/106457777
http://www.bubuko.com/infodetail-3504829.html

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值