ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

Ament Tutorial: Build Fails with Symlink

Trying build the ament package builder for ROS2 on windows. Getting the following errors. any suggestion on how resolve these?

Following the steps mentioned: https://github.com/ros2/ros2/wiki/Ament-Tutorial

PostBuildEvent:
setlocal
"C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd
– Install configuration: “Release”
– Execute custom install script
– Symlinking: D:/ROS/ros2_ws/install/share/ament_index/resource_index/package_run_dependencies/ament_cmake_core
failed to create symbolic link ‘D:/ROS/ros2_ws/install/share/ament_index/resource_index/package_run_dependencies/ament_cmake_core’: No error
CMake Error at ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:293 (message):
Could not create symlink
’D:/ROS/ros2_ws/install/share/ament_index/resource_index/package_run_dependencies/ament_cmake_core’
pointing to
’D:/ROS/ros2_ws/build/ament_cmake_core/ament_cmake_index/share/ament_index/resource_index/package_run_dependencies/ament_cmake_core’
Call Stack (most recent call first):
ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:149 (_ament_cmake_symlink_install_create_symlink)
ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:305 (ament_cmake_symlink_install_files)
cmake_install.cmake:31 (include)

I get the same error on Windows. I traditionally never build with --symlink-install, so I haven’t seen this in the past.
Building without that option on Windows works very well.

without --symlink-install i get same error

Did you try removing your build and install folder before building without the --symlink-install flag?
to do so you can run

rmdir /S build install

and then run ament again