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.colconros.prefixpath.catkin WARNING The path 'C:\opt\ros\foxy\x64\tools\vcpkg\installed\x64-windows' in the environment variable CMAKEPREFIXPATH doesn't exist
Starting >>> examplesrclcppcbgexecutor
Starting >>> examplesrclcppminimalactionclient
Starting >>> examplesrclcppminimalactionserver
Starting >>> examplesrclcppminimalclient
Starting >>> examplesrclcppminimalcomposition
Starting >>> examplesrclcppminimalpublisher
Starting >>> examplesrclcppminimalservice
--- stderr: examplesrclcppminimalservice
CMake Error: failed to create symbolic link 'C:/dev/ros2examplews/install/lib/examplesrclcppminimalservice/servicemain.exe': operation not permitted
CMake Error at amentcmakesymlinkinstall/amentcmakesymlinkinstall.cmake:302 (message):
Could not create symlink
'C:/dev/ros2examplews/install/lib/examplesrclcppminimalservice/servicemain.exe'
pointing to
'C:/dev/ros2examplews/build/examplesrclcppminimalservice/Release/servicemain.exe'
Call Stack (most recent call first):
amentcmakesymlinkinstall/amentcmakesymlinkinstall.cmake:264
(amentcmakesymlinkinstallcreatesymlink)
amentcmakesymlinkinstalltargets0Release.cmake:1 (amentcmakesymlinkinstalltargets)
amentcmakesymlinkinstall/amentcmakesymlinkinstall.cmake:314 (include)
cmakeinstall.cmake:36 (include)
---
Failed <<< examplesrclcppminimalservice [8.86s, exited with code 1]
Aborted <<< examplesrclcppminimalactionserver [8.98s]
Aborted <<< examplesrclcppminimalcomposition [9.22s]
Aborted <<< examplesrclcppminimalclient [9.86s]
Aborted <<< examplesrclcppasyncclient [10.0s]
Aborted <<< examplesrclcppminimalactionclient [10.6s]
Aborted <<< examplesrclcppcbgexecutor [11.9s]
Aborted <<< examplesrclcppminimalpublisher [11.8s]
Summary: 0 packages finished [12.6s]
1 package failed: examplesrclcppminimalservice
7 packages aborted: examplesrclcppasyncclient 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
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
Comments