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

CMake can't find C++ compiler in Linux Mint

asked 2015-11-30 03:45:31 -0500

BrunaGarcia gravatar image

updated 2015-11-30 04:39:36 -0500

gvdhoorn gravatar image

HI everyone, I'm using Linux Mint 17.2 and got this message below while trying to create a catkin workspace:

bruna@bruna-laptop ~/catkin_ws $ catkin_make
Base path: /home/bruna/catkin_ws
Source space: /home/bruna/catkin_ws/src
Build space: /home/bruna/catkin_ws/build
Devel space: /home/bruna/catkin_ws/devel
Install space: /home/bruna/catkin_ws/install
####
#### Running command: "cmake /home/bruna/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/bruna/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/bruna/catkin_ws/install -G Unix Makefiles" in "/home/bruna/catkin_ws/build"
####
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Using CATKIN_DEVEL_PREFIX: /home/bruna/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/bruna/catkin_ws/build/test_results
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.16
-- BUILD_SHARED_LIBS is on
-- Configuring incomplete, errors occurred!
See also "/home/bruna/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/bruna/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

I am a new user, so I dont know what I did here. Anyone can help?

edit retag flag offensive close merge delete

Comments

Also: please tell us how you installed ROS (which tutorial(s) did you follow, if any) and which version it is.

gvdhoorn gravatar image gvdhoorn  ( 2015-11-30 04:38:24 -0500 )edit

ROS indigo :)

BrunaGarcia gravatar image BrunaGarcia  ( 2015-11-30 05:32:50 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2015-11-30 04:37:47 -0500

gvdhoorn gravatar image

From:

-- The CXX compiler identification is unknown

and:

CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

I would say you don't have any C++ compiler installed.

can you try something like which g++ and append the output to your original question?

edit flag offensive delete link more

Comments

Yeah, you're right! Now it works. Followed this to solve the problem:

https://help.ubuntu.com/community/Ins...

Thank you!

BrunaGarcia gravatar image BrunaGarcia  ( 2015-11-30 05:32:10 -0500 )edit
0

answered 2019-04-17 01:05:44 -0500

Test to see if you have a C++ compiler installed to your Linux system?

Which g++
Which c++

$ which c++

/usr/bin/c++

$ which g++

/usr/bin/g++

If no c++ or g++ compiler found installed in binary programs directory like '/usr/bin/" Then CMAKE cannot determine the correct path to the C++ compiler.

$ which c++

/usr/bin/which: no c++ in (/home/fred/.local/bin:/home/fred/bin:/home/fred/.local/bin:/home/fred/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)

$ sudo apt-get install c++ or for Fedora29 $ sudo dnf install c++

I would say you don't have any C++ compiler installed. Then CMAKE can verify that you have a C++ compiler installed into your Linux System

For Fedora29 Linux, I typed c++ on bash shell terminal input line

$ c++ bash: c++: command not found...

Install package 'gcc-c++' to provide command 'c++'? [N/y] y

  • Waiting in queue...
    • Loading list of packages.... The following > packages have to be installed: > gcc-c++-8.3.1-2.fc29.x86_64 C++ > support for GCC Proceed with changes? > [N/y] y > >
    • Waiting in queue...
    • Waiting for authentication...
    • Waiting in queue...
    • Downloading packages...
    • Requesting data...
    • Testing changes...
    • Installing packages...

c++: fatal error: no input files compilation terminated.

[fred@localhost llvm]$ c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-11-30 03:45:31 -0500

Seen: 7,776 times

Last updated: Apr 17 '19