ros2 / examples

Example packages for ROS 2
Apache License 2.0
703 stars 312 forks source link

Fix errors under Windows #359

Closed MineYuanlu closed 1 year ago

MineYuanlu commented 1 year ago

Building under Windows can cause exceptions:

--- stderr: examples_rclcpp_minimal_subscriber
CMake Error at ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:267 (message):
  ament_cmake_symlink_install_targets() can't find
  'xxxxx/build/examples_rclcpp_minimal_subscriber/Release/wait_set_subscriber_library.lib'
Call Stack (most recent call first):
  ament_cmake_symlink_install_targets_3_Release.cmake:1 (ament_cmake_symlink_install_targets)
  ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:323 (include)
  cmake_install.cmake:36 (include)

refer to CSDN

clalancette commented 1 year ago

Can you give more detailed information about your setup, and how you are compiling? Because we have recently compiled this (see https://ci.ros2.org/job/ci_windows/19358/), and didn't see this issue.

MineYuanlu commented 1 year ago

Can you give more detailed information about your setup, and how you are compiling? Because we have recently compiled this (see https://ci.ros2.org/job/ci_windows/19358/), and didn't see this issue.

I'm not sure if this is my own problem

OS: Windows 11 ROS2: ros2-humble-20230308-windows-release-amd64 Cmake: 3.26.3 CODE: #fac7da74281cbe6912e74aa78db633945b9ed930

Follow the installation tutorial for everything else: Beginner CLI Tools

Custom startup script:

@set PATH=C:\Python38\Scripts\;C:\Python38\;%PATH%
@cd /d D:\yuanlu\dev\ros2\projects
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
@call D:\yuanlu\dev\ros2\ros2-humble-20230308-windows-release-amd64\local_setup.bat 
@echo.
@echo ROS2 is ready
@echo.

Log:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.19
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
"[rti_connext_dds_cmake_module][warning] RTI Connext DDS environment script not found (\resource\scripts\rtisetenv_x64Win64VS2017.bat). RTI Connext DDS will not be available at runtime, unless you already configured PATH manually."

ROS2 is ready

D:\yuanlu\dev\ros2\projects>cd D:\yuanlu\dev\ros2\projects\test-ros

D:\yuanlu\dev\ros2\projects\test-ros>colcon build --symlink-install --merge-install
Starting >>> examples_rclcpp_async_client
Starting >>> examples_rclcpp_cbg_executor
Starting >>> examples_rclcpp_minimal_action_client
Starting >>> examples_rclcpp_minimal_action_server
Starting >>> examples_rclcpp_minimal_client
Starting >>> examples_rclcpp_minimal_composition
Starting >>> examples_rclcpp_minimal_publisher
Starting >>> examples_rclcpp_minimal_service
Starting >>> examples_rclcpp_minimal_subscriber
Starting >>> examples_rclcpp_minimal_timer
Starting >>> examples_rclcpp_multithreaded_executor
Starting >>> examples_rclcpp_wait_set
Starting >>> examples_rclpy_executors
Starting >>> examples_rclpy_guard_conditions
Starting >>> examples_rclpy_minimal_action_client
Starting >>> examples_rclpy_minimal_action_server
--- stderr: examples_rclpy_guard_conditions
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_guard_conditions [8.75s]
Starting >>> examples_rclpy_minimal_client
--- stderr: examples_rclpy_executors
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_executors [9.22s]
--- stderr: examples_rclpy_minimal_action_client
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_action_client [8.99s]
--- stderr: examples_rclpy_minimal_action_server
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_action_server [8.91s]
Starting >>> examples_rclpy_minimal_publisher
Starting >>> examples_rclpy_minimal_service
Starting >>> examples_rclpy_minimal_subscriber
--- stderr: examples_rclpy_minimal_client
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_client [9.34s]
Starting >>> examples_rclpy_pointcloud_publisher
--- stderr: examples_rclpy_minimal_subscriber
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_subscriber [8.69s]
--- stderr: examples_rclpy_minimal_service
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_service [9.05s]
--- stderr: examples_rclpy_minimal_publisher
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_minimal_publisher [9.39s]
Starting >>> launch_testing_examples
Starting >>> turtlesim
--- stderr: examples_rclpy_pointcloud_publisher
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< examples_rclpy_pointcloud_publisher [6.75s]
--- stderr: launch_testing_examples
c:\python38\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< launch_testing_examples [6.31s]
Finished <<< examples_rclcpp_async_client [34.8s]
Finished <<< examples_rclcpp_minimal_client [34.4s]
Finished <<< examples_rclcpp_minimal_service [35.8s]
Finished <<< examples_rclcpp_multithreaded_executor [36.6s]
Finished <<< examples_rclcpp_minimal_action_server [39.5s]
Finished <<< examples_rclcpp_minimal_timer [39.7s]
Finished <<< examples_rclcpp_minimal_action_client [51.6s]
Finished <<< examples_rclcpp_minimal_composition [51.4s]
Finished <<< examples_rclcpp_cbg_executor [52.0s]
Finished <<< examples_rclcpp_minimal_publisher [1min 0s]
[Processing: examples_rclcpp_minimal_subscriber, examples_rclcpp_wait_set, turtlesim] 1min 29.8s] [examples_rclcpp_wait_set:build - 1min 29.3s] [turtlesim:build - 1min 10.2s]
--- stderr: examples_rclcpp_minimal_subscriber
CMake Error at ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:267 (message):
  ament_cmake_symlink_install_targets() can't find
  'D:/yuanlu/dev/ros2/projects/test-ros/build/examples_rclcpp_minimal_subscriber/Release/wait_set_subscriber_library.lib'
Call Stack (most recent call first):
  ament_cmake_symlink_install_targets_3_Release.cmake:1 (ament_cmake_symlink_install_targets)
  ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:323 (include)
  cmake_install.cmake:36 (include)

---
Failed   <<< examples_rclcpp_minimal_subscriber [1min 32s, exited with code 1]
Aborted  <<< turtlesim [1min 15s]
Aborted  <<< examples_rclcpp_wait_set [1min 37s]

Summary: 20 packages finished [1min 39s]
  1 package failed: examples_rclcpp_minimal_subscriber
  2 packages aborted: examples_rclcpp_wait_set turtlesim
  11 packages had stderr output: examples_rclcpp_minimal_subscriber examples_rclpy_executors examples_rclpy_guard_conditions examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server examples_rclpy_minimal_client examples_rclpy_minimal_publisher examples_rclpy_minimal_service examples_rclpy_minimal_subscriber examples_rclpy_pointcloud_publisher launch_testing_examples
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)