CMAKE_C_COMPILER不是现有编译器工具的完整路径 [英] CMAKE_C_COMPILER is not a full path to an existing compiler tool

查看:10782
本文介绍了CMAKE_C_COMPILER不是现有编译器工具的完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近研究了distcc,但无法使其工作。所以我

  sudo apt-get remove distcc 

之后,我收到错误

  ==>处理catkin包:'gencpp'
==>使用env构建:'/opt/ros/kinetic/env.sh'
Makefile存在,跳过显式的cmake调用...
==>在'/ home / pi / ros_catkin_ws / build_isolated / gencpp'中创建cmake_check_build_system
- C编译器标识未知
- CXX编译器标识未知
CMake CMakeLists.txt错误: 2(project):
CMAKE_C_COMPILER:

/ usr / local / bin / cc

不是现有编译器工具的完整路径。
通过将环境
变量CC或者CMake缓存项CMAKE_C_COMPILER设置为编译器的完整路径,或者如果编译器名在PATH中,告诉CMake在哪里可以找到编译器。

CMake Error at CMakeLists.txt:2(project):
CMAKE_CXX_COMPILER:

/ usr / local / bin / c ++

不是现有编译器工具的完整路径。
通过将环境变量CXX或CMake缓存项CMAKE_CXX_COMPILER设置为编译器的完整路径或编译器名称(如果它位于PATH中),告诉CMake在哪里可以找到编译器。

- 配置不完整,发生错误!
另请参阅/home/pi/ros_catkin_ws/build_isolated/gencpp/CMakeFiles/CMakeOutput.log。
另请参阅/home/pi/ros_catkin_ws/build_isolated/gencpp/CMakeFiles/CMakeError.log。
Makefile:304:目标配方'cmake_check_build_system'失败
make:*** [cmake_check_build_system]错误1
< ==无法处理包'gencpp':
命令'['/opt/ros/kinetic/env.sh','make','cmake_check_build_system']'返回非零退出状态2

运行以下代码重现此错误:
= => cd / home / pi / ros_catkin_ws / build_isolated / gencpp&& /opt/ros/kinetic/env.sh make cmake_check_build_system

命令失败,正在退出。

我已完成

  sudo apt-get install build_essential 
sudo apt-get -f install
sudo apt-get update $ b $ sudo apt-get upgrade
export CC = / usr / local / bin / gcc
export CXX = / usr / local / bin / g ++

但仍然得到相同的错误。



我怎样才能解决这个错误?我试图重置符号链接并删除导出

解决方案

我想你应该取消设置 CC

code>和 CXX ,或者至少使用系统编译器,像这样(删除 / local ) :

  export CC = / usr / bin / gcc 
export CXX = / usr / bin / g ++


I recently explored distcc and couldn't make it work. So I

sudo apt-get remove distcc

After that, I get the error

==> 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.

I have done

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++

but still get the same error.

How could I resolve this error? I have tried resetting the symbolic links and removing the exports

解决方案

I think you should unset CC and CXX, or at least use the system compilers, like this (drop the /local):

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++

这篇关于CMAKE_C_COMPILER不是现有编译器工具的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆