-
Notifications
You must be signed in to change notification settings - Fork 522
Description
Generated by Generative AI
No response
Operating System:
Microsoft Windows [Version 10.0.26100.4061]
ROS version or commit hash:
kilted, commit 1bd4bec
RMW implementation (if applicable):
No response
RMW Configuration (if applicable):
No response
Client library (if applicable):
rclcpp
'ros2 doctor --report' output
No response
Steps to reproduce issue
- From a clean Windows 11 install, I followed the Kilted source build instructions: https://docs.ros.org/en/kilted/Installation/Alternatives/Windows-Development-Setup.html, but using MSVC 2022 instead.
- I have installed VS BuildTools 2022 17.14.0 and MSVC v143 VS 2022 x64/x86 build tools.
- I follow the same Kilted build instructions, sourcing the VS 2022 environment instead.
- Source the VS BuildTools environment (via vcvarsall.bat) and the pixi environment
colcon build --merge-install- rclcpp fails to build. The key errors are in test_events_queue and test_waitable. In both, error C2039 is encountered: 'chrono_literals': is not a member of 'std'.
Expected behavior
rclcpp and its tests should successfully build.
Actual behavior
The build fails. This is due to a breaking change in Visual Studio (mentioned in https://devblogs.microsoft.com/cppblog/whats-new-for-c-developers-in-visual-studio-2022-17-13/). std::chrono is no longer included in common STL headers, and instead needs to be included from the header.
Adding #include to the header files for test_events_queue and test_waitable allows it to successfully build with MSVC 2022. I do not know if this would prevent it from successfully building with MSVC 2019, or with other compilers / operating systems.
The streams.log from this build is here:
Additional information
See https://devblogs.microsoft.com/cppblog/whats-new-for-c-developers-in-visual-studio-2022-17-13/ for information on the header changes.