CMAKE_C_COMPILER不是现有编译器工具的完整路径

Rya*_*Lee 6 gcc makefile g++ distcc

我最近浏览了distcc,无法使其正常运行。所以我

sudo apt-get remove distcc
Run Code Online (Sandbox Code Playgroud)

之后,我得到了错误

==> 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.
Run Code Online (Sandbox Code Playgroud)

我已经做好了

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++
Run Code Online (Sandbox Code Playgroud)

但仍然出现相同的错误。

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

Flo*_*mer 4

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

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
Run Code Online (Sandbox Code Playgroud)

  • 呃哦。`apt-get install --reinstall gcc` 应重新安装 `gcc` 软件包并更正符号链接。 (2认同)