ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

catkin_make error melodic

asked 2018-06-21 09:56:14 -0600

dlrlr gravatar image

updated 2018-06-25 11:18:03 -0600

gvdhoorn gravatar image

I got this error after ran the catkin_make command line:

$ catkin_make
Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/user/catkin_ws/build"
####
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  The CMAKE_CXX_COMPILER:

    /usr/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/user/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:530: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

I am using ubuntu 17.10 and installed version: ros melodic. Could someone help me to fit it.


Edit: Here my setup output as suggested from you:

$ ls -al /usr/bin/c++
lrwxrwxrwx 1 root root 21 Dec 25 22:30 /usr/bin/c++ -> /etc/alternatives/c++

and:

$ echo $CXX
/usr/bin/g++

Currently, I try to reinstall and do the same thing and make it different error output, like:

catkin_make Base path: /home/user/catkin_ws Source space: /home/user/catkin_ws/src Build space: /home/user/catkin_ws/build Devel space: /home/user/catkin_ws/devel Install space: /home/user/catkin_ws/install
####
#### Running command: "cmake /home/user/catkin_ws/src
-DCATKIN_DEVEL_PREFIX=/home/user/catkin_ws/devel
-DCMAKE_INSTALL_PREFIX=/home/user/catkin_ws/install
-G Unix Makefiles" in "/home/user/catkin_ws/build"
####
-- The CXX compiler identification is unknown CMake Error in CMakeLists.txt: No CMAKE_CXX_COMPILER could be found.

  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/user/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed

Edit2:

I am currently using catkin to install and it cannot detect the CMAKE_CXX_COMPILER. I tried to put all related files here for you to understanding my installation.

$ catkin_make
Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install
####
#### Running command: "cmake /home/user/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/user/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/user/catkin_ws/install -G Unix Makefiles" in "/home/user/catkin_ws/build"
####
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  No CMAKE_CXX_COMPILER could be found.

  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/user/catkin_ws ...
(more)
edit retag flag offensive close merge delete

Comments

I trying to put all related files here for people find the error my setup in this question.

dlrlr gravatar image dlrlr  ( 2018-06-25 11:12:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-21 11:57:28 -0600

gvdhoorn gravatar image

updated 2018-06-22 00:59:37 -0600

Do you actually have a C++ compiler installed?

Try the following:

sudo apt-get update && sudo apt-get install build-essential

I would've assumed that would be installed automatically, but perhaps that is not true for your system.

Then rm -rf /home/user/catkin_ws/{build,devel} and try again.


Edit: and you can run /usr/bin/c++?


Edit2: your latest edit makes me wonder if you really do have a C++ compiler installed.

Please run:

sudo apt-get install build-essential g++

Then rm -rf /home/user/catkin_ws/{build,devel} and try again.

edit flag offensive delete link more

Comments

Yes, I already install C++ compiler, I actually checked. I tried your instructions but don't work.

dlrlr gravatar image dlrlr  ( 2018-06-21 12:10:28 -0600 )edit
1

"don't work" is a bit vague. You cannot install the package, or even with that pkg it doesn't change the output of catkin_make?

Ignoring that: are you setting the CXX environment variable in your shell? What is the output of ls -al /usr/bin/c++? And of echo $CXX?

gvdhoorn gravatar image gvdhoorn  ( 2018-06-21 12:14:08 -0600 )edit

Sorry to say, it didn't work

dlrlr gravatar image dlrlr  ( 2018-06-25 11:14:34 -0600 )edit

Then why did you mark the question as answered?

gvdhoorn gravatar image gvdhoorn  ( 2018-06-25 11:18:53 -0600 )edit

I'm not sure what else to suggest. It seems there is a problem with CMake not being able to detect your C++ compiler.

Can you use CMake for C++ in a stand-alone project (ie: without ROS)?

gvdhoorn gravatar image gvdhoorn  ( 2018-06-26 04:45:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-21 09:56:14 -0600

Seen: 2,610 times

Last updated: Jun 25 '18