3

I am following these tutorials:

In step catkin_make i'm getting error:

-- The C compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:186 (configure_file):
configure_file Problem configuring file

-- The CXX compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:185 (configure_file):
configure_file Problem configuring file

-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
Unknown extension ".c" for file

/home/manoj/catkin_ws/build/CMakeFiles/CMakeTmp/testCCompiler.c

try_compile() works only for enabled languages.  Currently these are:

C CXX

See project() command to enable other languages.

-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.

It fails with the following output:

I tried setting environment variables CC and CXX to /usr/bin/gcc and /usr/bin/g++, but to no use.

Also tried a fresh install of cmake, still no use. I am using Ubuntu on Windows Subsystem for Linux.

Help! Thanks in Advance.

Manoj
  • 314
  • 1
  • 2
  • 12
  • It doesn't seem logicaly, but can you try adding [`ENABLE_LANGUAGE(C)`](http://www.grokit.ca/cnt/CMakeProblemsSolutions/)? – Antonio May 25 '16 at 08:11
  • If you want you can try to [update your CMake](http://askubuntu.com/questions/355565/how-to-install-latest-cmake-version-in-linux-ubuntu-from-command-line/595441#595441). – Antonio May 25 '16 at 08:13

2 Answers2

1

try adding the following lines to your CMakeLists.txt before the catkin_package() :

set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")

Sometimes, it's also better to clean up your build (usually by deleting the /devel and /build folders in your catkin_ws) and do a fresh catkin_make.

For the record, this approach is not recommended (see here, method 3), but it may help !

Vtik
  • 3,073
  • 2
  • 23
  • 38
0

The error is with the cmake on WSL. Fix is inbound. Report, discussion & repro's over here: Bash on Windows: Bugs

Manoj
  • 314
  • 1
  • 2
  • 12