Robotics StackExchange | Archived questions

Compiler error while building a ROS2 code

I have installed ROS2 from binary on Windows.

I have also installed all the dependencies.

I can run the demo nodes.

Now I created an overlay workspace.

When I try to build it using ament build or ament build --symlink-install, it starts to compile but it does not find any compiler. The exact error is :

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.


CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.

Do I need to install some other dependencies ? I have installed VS2015 and I am running the commands from a VS command prompt.

Asked by aks on 2018-06-22 03:39:18 UTC

Comments

Do all builds using CMake have the same error? Here's an example to see if any cmake build works: http://derekmolloy.ie/hello-world-introductions-to-cmake/#Example_1_The_Hello_World_Example

Asked by sloretz on 2018-06-22 09:31:43 UTC

@sloretz : This works...I can generate the .sln project by using cmake .. Although I have not tried to build it. Shall I try that as well ? msbuild hello.sln fails

Asked by aks on 2018-06-22 10:09:21 UTC

Answers

Is Visual Studio installed with C++ support? This is appears to be a CMake question rather than something specific to ROS 2. Try following the answers here https://stackoverflow.com/questions/32801638/cmake-error-at-cmakelists-txt30-project-no-cmake-c-compiler-could-be-found

Not related to your question, Visual Studio 2015 is the right version if using ROS 2 Ardent or earlier. If you're using a nightly then Visual Studio 2017 will need to be installed.

Asked by sloretz on 2018-06-22 10:21:20 UTC

Comments

Yes, VS2015 is installed with C++ support.

Asked by aks on 2018-06-22 10:34:37 UTC

@sloretz : upgraded to Nighty, installed VS2017 with C++ support. Still the same error. Looking at the stackoverflow question, everything works as expected. Any suggestions ?

Asked by aks on 2018-06-23 07:15:18 UTC

No idea. Can anything be built using cmake on that machine? Here's a minimal cmake project to try to build https://github.com/jameskbride/cmake-hello-world

Asked by sloretz on 2018-06-25 10:29:15 UTC