[Windows] Building uncrustify_vendor: No CMAKE_CXX_COMPILER could be found

asked 2021-11-29 00:51:21 -0500

aprotyas gravatar image

updated 2021-11-29 01:07:28 -0500

I'm building the ROS 2 packages from source following the Windows source tutorial, but I'm getting stuck when I try to build the uncrustify_vendor package. CMake reports that C/C++ compilers cannot be found. Following is the traceback I see:

C:\dev\ros2_rolling>colcon build --merge-install --packages-select uncrustify_vendor --event-handlers console_direct+
Starting >>> uncrustify_vendor
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- Found ament_cmake: 1.2.0 (C:/dev/ros2_rolling/install/share/ament_cmake/cmake)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/ros2_rolling/build/uncrustify_vendor
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Performing configure step for 'uncrustify-45b836cff040594994d364ad6fd3f04adc890a26'
  -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
  -- 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.



  -- Configuring incomplete, errors occurred!
  See also "C:/dev/ros2_rolling/build/uncrustify_vendor/uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-prefix/src/uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-build/CMakeFiles/CMakeOutput.log".
  See also "C:/dev/ros2_rolling/build/uncrustify_vendor/uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-prefix/src/uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-build/CMakeFiles/CMakeError.log".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\dev\ros2_rolling\build\uncrustify_vendor\CMakeFiles\d177f57d11cdf441cb98984155862ddc\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-configure.rule;C:\dev\ros2_rolling\build\uncrustify_vendor\CMakeFiles\d177f57d11cdf441cb98984155862ddc\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-build.rule;C:\dev\ros2_rolling\build\uncrustify_vendor\CMakeFiles\d177f57d11cdf441cb98984155862ddc\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-install.rule;C:\dev\ros2_rolling\build\uncrustify_vendor\CMakeFiles\1f61a89c37b27fe4d1c79f10968d9730\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26-complete.rule;C:\dev\ros2_rolling\build\uncrustify_vendor\CMakeFiles\6aaed628ba48b5d83eef28c741094c56\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26.rule;C:\dev\ros2_rolling\src\ament\uncrustify_vendor\CMakeLists.txt' exited with code 1. [C:\dev\ros2_rolling\build\uncrustify_vendor\uncrustify-45b836cff040594994d364ad6fd3f04adc890a26.vcxproj]
Failed   <<< uncrustify_vendor [6.84s, exited with code 1]

Summary: 0 packages finished [10.4s]
  1 package failed: uncrustify_vendor

Any clues what could be going wrong here? I've done:

  1. Simple sanity checks in building test programs with cmake and Visual C++ 2019.
  2. Read (and tried suggestions) some stackoverflow posts about similar reports.
  3. Read some ROS answers posts about similar reports.

    One commenter suggested replacing the CMakeLists.txt file in uncrustify_vendor with that of an older distribution (Foxy) - this worked, but I'm not sure why it did and whether that reflects a bug in the master branch or just a regression in my setup. Should I report this as an issue on Github?

Any help would be much appreciated!

edit retag flag offensive close merge delete

Comments

For clarity: I HAVE solved the issue temporarily.

One commenter suggested replacing the CMakeLists.txt file in uncrustify_vendor with that of an older distribution (Foxy) - this worked.

I'm not sure why it did and whether that reflects a bug in the master branch or just a regression in my setup. Should I report this as an issue on Github?

aprotyas gravatar image aprotyas  ( 2021-11-29 01:08:20 -0500 )edit

Hi @aprotyas. I recently started playing ROS on Windows and there is little documentation for issues, so adding issues to the repo or answering in this forum will be very beneficial.

osilva gravatar image osilva  ( 2021-11-29 10:50:58 -0500 )edit