DEBUG-ninja: xxx was unable to find xxx corresponding to “Ninja“

​来源: “码农不会写诗”公众号
链接:DEBUG-ninja: xxx was unable to find xxx corresponding to “Ninja”

NOTE-ninja

  Ninja 是一款注重速度的小型编译系统。其通过解析构建文件建立一个有向无环任务图,通过图的依赖关系确定需要构建的任务并且并行执行,极大的提高构建效率!


01 现象描述

以下为使用Ninja基于cmake编译时的报错信息,只要是出现类似xxx was unable to find a build program corresponding to “Ninja”,本文均适用

CMake Error: CMake was unable to find a build program corresponding to “Ninja”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!

在这里插入图片描述

02 原因分析

使用Ninja基于cmake构建编译任务时,没有找到名为ninja的可执行文件,也就是没有安装Ninja

03 解决方案

sudo apt-get update
sudo apt-get install ninja-build -y

04 内容总结

在使用ninja前,可通过以下命令确认是否安装及查看版本是否正确

ninja --version

未安装:

bash: /usr/bin/ninja: No such file or directory

已安装,输出版本号:

1.10.1

  • 15
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

码农不会写诗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值