mklink for hpp file got an error

Junjun Fan(Jason) 0 Reputation points
2024-08-07T09:50:09.1833333+00:00

Hi:

I am trying to build a ros2 demo which requires a symlink in the middle, and I got an error here:

Starting >>> examples_rclcpp_minimal_composition

--- stderr: examples_rclcpp_cbg_executor

CMake Error: failed to create symbolic link 'C:/dev/ros2_ws/install/include/examples_rclcpp_cbg_executor/ping_node.hpp': ��������ȷ��

CMake Error at ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:302 (message):

Could not create symlink

'C:/dev/ros2_ws/install/include/examples_rclcpp_cbg_executor/ping_node.hpp'

pointing to

'C:/dev/ros2_ws/src/examples/rclcpp/executors/cbg_executor/include/examples_rclcpp_cbg_executor/ping_node.hpp'

then I did some tests to check if mklink is ready , below is my test:

C:\dev\ros2_ws>mklink 1.hpp C:\dev\ros2_ws\src\examples\rclcpp\executors\cbg_executor\include\examples_rclcpp_cbg_executor\ping_node.hpp

The device does not support symbolic links.

C:\dev\ros2_ws>mklink 1.exe C:\dev\ros2_ws\src\examples\rclcpp\executors\cbg_executor\include\examples_rclcpp_cbg_executor\ping_node.hpp

symbolic link created for 1.exe <<===>> C:\dev\ros2_ws\src\examples\rclcpp\executors\cbg_executor\include\examples_rclcpp_cbg_executor\ping_node.hpp

C:\dev\ros2_ws>mklink notepad.exe C:\Windows\System32\notepad.exe

symbolic link created for notepad.exe <<===>> C:\Windows\System32\notepad.exe

It looks like only when I make a symlink a file named after **hpp, it fails, in other cases , it works..

But I can't figure why and I can't pre symlink before building since it will clear the dest dir

My Windows configure is like this:

Windows 10,22H2 19045.4651

So, do u have any idea about this problem, I will be appreciate if u have any advice

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
937 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,881 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.