我最近探索了 distcc,但无法让它工作。所以我
sudo apt-get remove distcc
在那之后,我得到错误
==> Processing catkin package: 'gencpp'
==> Building with env: '/opt/ros/kinetic/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/pi/ros_catkin_ws/build_isolated/gencpp'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_C_COMPILER:
/usr/local/bin/cc
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_COMPILER:
/usr/local/bin/c++
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/home/pi/ros_catkin_ws/build_isolated/gencpp/CMakeFiles/CMakeOutput.log".
See also "/home/pi/ros_catkin_ws/build_isolated/gencpp/CMakeFiles/CMakeError.log".
Makefile:304: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
<== Failed to process package 'gencpp':
Command '['/opt/ros/kinetic/env.sh', 'make', 'cmake_check_build_system']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/gencpp && /opt/ros/kinetic/env.sh make cmake_check_build_system
Command failed, exiting.
我做了
sudo apt-get install build_essential
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
但仍然出现相同的错误。
我该如何解决这个错误?我尝试重置符号链接并删除导出
我认为你应该取消设置
CC
和CXX
,或者至少使用系统编译器,像这样(删除/local
):
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
我在 ubuntu 18.04 上使用 cuda 10.2 安装 openCV 4.2.0 时遇到了类似的错误。我通过(相应地更改 gcc/g++ 版本)纠正了它
sudo apt install gcc-6 g++-6
你需要检查你的gcc和g++所在的位置,并做一个软链接 因为我用的是 CentOS
yum -y install centos-release-scl
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
安装 gcc 所以我需要做以下事情来避免和你一样的错误
sudo ln -s /opt/rh/devtoolset-8/root/usr/bin/gcc /usr/bin/cc
sudo ln -s /opt/rh/devtoolset-8/root/usr/bin/g++ /usr/bin/c++
以上所有建议都没有解决我在 Ubuntu 18.04 上的问题,它对我有用:
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-7 70
我已经有了:
sudo update-alternatives --install /usr/bin/c++ g++ /usr/bin/g++-7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70
我在用cuda优化编译opencv时经历了这个问题。编译器发出此消息:
CMAKE_C_COMPILER:
/usr/bin/gcc-6
不是现有编译器工具的完整路径。
消息实际上很清楚,因为它只是告诉它没有在指示的位置找到 gcc-6,在这种情况下是
/usr/bin/gcc-6
。为了验证这一点,我导航到 /usr/bin/
文件夹并运行命令 ls gcc*
以查看所有可用的 gcc GNU C 编译器。
正如人们所看到的,它们不是
gcc-6
可用的,而是 gcc-9
可用的。因此,我只需要指出相关路径-D CMAKE_C_COMPILER=/usr/bin/gcc-9
,每件事都能找到。