Robotics StackExchange | Archived questions

colcon build fails while following tutorial

Hi, I'm just starting out with ROS2 Foxy. I installed it on windows and I got to the part of the tutorial where I am to build an example using colcon. No matter what I do, I get the following error:

C:\dev\ros2examplews>colcon build --symlink-install --merge-install
[0.981s] root DEBUG Using proactor: IocpProactor
Starting >>> examplesrclcppasyncclient
[0.999s] colcon.colcon
ros.prefixpath.catkin WARNING The path 'C:\opt\ros\foxy\x64\tools\vcpkg\installed\x64-windows' in the environment variable CMAKEPREFIXPATH doesn't exist
Starting >>> examples
rclcppcbgexecutor
Starting >>> examplesrclcppminimalactionclient
Starting >>> examplesrclcppminimalactionserver
Starting >>> examplesrclcppminimalclient
Starting >>> examples
rclcppminimalcomposition
Starting >>> examplesrclcppminimalpublisher
Starting >>> examples
rclcppminimalservice
--- stderr: examplesrclcppminimalservice
CMake Error: failed to create symbolic link 'C:/dev/ros2
examplews/install/lib/examplesrclcppminimalservice/servicemain.exe': operation not permitted
CMake Error at ament
cmakesymlinkinstall/amentcmakesymlinkinstall.cmake:302 (message): Could not create symlink
'C:/dev/ros2
examplews/install/lib/examplesrclcppminimalservice/servicemain.exe' pointing to
'C:/dev/ros2
examplews/build/examplesrclcppminimalservice/Release/servicemain.exe' Call Stack (most recent call first):
ament
cmakesymlinkinstall/amentcmakesymlinkinstall.cmake:264
(
amentcmakesymlinkinstallcreatesymlink)
ament
cmakesymlinkinstalltargets0Release.cmake:1 (amentcmakesymlinkinstalltargets)
ament
cmakesymlinkinstall/amentcmakesymlinkinstall.cmake:314 (include)
cmake
install.cmake:36 (include)

---
Failed <<< examplesrclcppminimalservice [8.86s, exited with code 1]
Aborted <<< examples
rclcppminimalactionserver [8.98s]
Aborted <<< examples
rclcppminimalcomposition [9.22s]
Aborted <<< examplesrclcppminimalclient [9.86s]
Aborted <<< examples
rclcppasyncclient [10.0s]
Aborted <<< examplesrclcppminimalactionclient [10.6s]
Aborted <<< examplesrclcppcbgexecutor [11.9s]
Aborted <<< examples
rclcppminimalpublisher [11.8s]

Summary: 0 packages finished [12.6s]
1 package failed: examplesrclcppminimalservice
7 packages aborted: examples
rclcppasyncclient examplesrclcppcbgexecutor examplesrclcppminimalactionclient examplesrclcppminimalactionserver examplesrclcppminimalclient examplesrclcppminimalcomposition examplesrclcppminimalpublisher
2 packages had stderr output: examplesrclcppminimalactionserver examplesrclcppminimal_service
14 packages not processed

I am running the command through Native Tools, Admin. Any help will be appreciated.

Asked by grubekoty on 2022-07-15 05:50:09 UTC

Comments

Answers

I can't believe how dumb the issue was. I was following the tutorial for humble, and the command was as follows: git clone https://github.com/ros2/examples src/examples -b humble all you need to do to make it work for foxy is substitute "foxy" for "humble": git clone https://github.com/ros2/examples src/examples -b foxy

hope these 4 hours will at leas save someone some time.

Asked by grubekoty on 2022-07-15 07:06:00 UTC

Comments

I don't have enough points to mark this as the answer.

Asked by grubekoty on 2022-07-15 07:07:03 UTC