14

我最近探索了 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++

但仍然得到同样的错误。

我该如何解决这个错误?我尝试重置符号链接并删除导出

4

4 回答 4

2

在 ubuntu 18.04 上安装带有 cuda 10.2 的 openCV 4.2.0 时,我遇到了类似的错误。我通过(相应地更改 gcc/g++ 版本)对其进行了纠正

sudo apt install gcc-6 g++-6
于 2020-04-17T15:59:28.553 回答
2

我认为您应该取消设置CCand CXX,或者至少使用系统编译器,如下所示(删除/local):

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
于 2017-07-17T12:33:33.830 回答
1

你需要检查你的 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++

于 2019-11-10T07:20:53.440 回答
0

以上所有建议都不能解决我在 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
于 2020-06-15T13:08:18.673 回答