cmake: Command not found

文章讲述了如何处理CMake编译时遇到的commandnotfound错误,包括检查CMake是否安装、添加至环境变量以及重置并重新配置CMake的过程。
摘要由CSDN通过智能技术生成

cmake: command not found这个错误表示你的系统上没有安装CMake,
或者CMake没有被正确地添加到环境变量中。

wcx@wcx:~/Desktop/output/OpenGL2/build$ make
make: /opt/homebrew/Cellar/cmake/3.25.1/bin/cmake: Command not found
make: *** [Makefile:228: cmake_check_build_system] Error 127

要解决这个问题,你可以尝试以下步骤:

1:确认是否已经安装了CMake。在终端中运行以下命令来检查:
cmake --version

wcx@wcx:~/Desktop/output/OpenGL2$ cmake --version
cmake version 3.16.3

如果已经安装了CMake,这个命令会输出CMake的版本信息。如果没有安装,你需要先安装CMake。

2: 如果确认已经安装了CMake,但仍然出现这个错误,那么可能是因为CMake没有被正确地添加到环境变量中。
删除build下的所有,重新CMake。

wcx@wcx:~/Desktop/output/OpenGL2/build$ cd ..
wcx@wcx:~/Desktop/output/OpenGL2$ cd build
wcx@wcx:~/Desktop/output/OpenGL2/build$ rm -rf *
wcx@wcx:~/Desktop/output/OpenGL2/build$ ls
wcx@wcx:~/Desktop/output/OpenGL2/build$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
www,/home/wcx/Desktop/output/OpenGL2/build
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wcx/Desktop/output/OpenGL2/build

已解决

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值