c++ - cmake 和 /opt/cmake/bin/cmake 显示不同的版本
问题描述
我对 C++ 编程和 cmake 很陌生。如果问题看起来很简单,请多多包涵。
我正在构建一个应用程序,其中 cmake 3.9.0 是所需的最低版本。
Setup.sh: Building rpclib with libc++.
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.9.0 or higher is required. You are running version 3.5.1
所以我计划升级cmake版本并点击以下链接。
注意:为了清楚起见,我不想清除现有版本,因为它可能会影响我系统中的ROS环境。
我已经完成了下面给出的安装和结果。
当我运行时cmake -version
:
kk@kk-Lenovo-ideapad-320-15ISK:~/cmake-3.9.0$ cmake -version
cmake version 3.5.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
kk@kk-Lenovo-ideapad-320-15ISK:~/cmake-3.9.0$
当我跑步时/opt/cmake/bin/cmake -version
kk@kk-Lenovo-ideapad-320-15ISK:~/cmake-3.9.0$ /opt/cmake/bin/cmake --version
cmake version 3.9.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
kk@kk-Lenovo-ideapad-320-15ISK:~/cmake-3.9.0$
应用程序构建的问题/错误与以前相同。
您能否帮我更新 cmake 或修复此现有版本问题。
谢谢
KK
解决方案
这听起来像是一个 PATH 问题。您必须更改 PATH 变量,以便 Setup.sh 在早期版本之前找到您的 cmake。在运行 Setup.sh 之前尝试此操作
export PATH=/opt/cmake/bin:$PATH
推荐阅读
- node.js - 在 mongodb 中,如果值已经存在,我想在最佳页面中显示它们以及它们的条目号
- javascript - 使用 Sphinx 生成的 HTML 删除了“模块”一词
- python - 在不重置内核的情况下清除 Pytorch 和 Jupyter Notebook 中的部分 CUDA 内存?
- android-studio - Gradle 任务未显示在 Android Studio 4.2 的 gradle 工具窗口中
- apache-spark - 文档中getAMContainerId的描述说明
- c - 当我要使用 printf 打印十六进制值时,它会将输入作为十进制值,为什么?
- javascript - 如何同时使用类和道具 javascript react native
- c++ - parsing the ip/mac adrs from a QStringList
- python - 使用 Selenium 和 BeautifulSoup 价格问题抓取 lowes.com
- angular - 如何用泛型类模拟 route.snapshot.params?