Ask Your Question

Compiler error while building a ROS2 code

asked 2018-06-22 03:39:18 -0600

aks gravatar image

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.

edit retag flag offensive close merge delete


Do all builds using CMake have the same error? Here's an example to see if any cmake build works:

sloretz gravatar image sloretz  ( 2018-06-22 09:31:43 -0600 )edit

@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

aks gravatar image aks  ( 2018-06-22 10:09:21 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-22 10:21:20 -0600

sloretz gravatar image

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

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.

edit flag offensive delete link more


Yes, VS2015 is installed with C++ support.

aks gravatar image aks  ( 2018-06-22 10:34:37 -0600 )edit

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

aks gravatar image aks  ( 2018-06-23 07:15:18 -0600 )edit

No idea. Can anything be built using cmake on that machine? Here's a minimal cmake project to try to build

sloretz gravatar image sloretz  ( 2018-06-25 10:29:15 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-06-22 03:39:18 -0600

Seen: 231 times

Last updated: Jun 22 '18