How to increase CMAKE_OBJECT_PATH_MAX for ros2genmsg function

78 views (last 30 days)
I am working on windows 10.
I have enabled long paths and confirmed they are enabled in the registry.
I cannot shorten the name or directory path any further. The package name is a little long at 20 characters, but it is a actively worked on externally managed package so I cannot change it.
********* has 198 characters. The maximum full path to an object file is 250 characters (see CMAKE_OBJECT_PATH_MAX). Object file ********* cannot be safely placed under this directory. The build may not work correctly.
the path name in question it wants to use has 238 characters auto generated. This leaves me with 22 characters for whatever directories on my local machine. I am working collaboratively in a series of dropbox folders, so I would prefer not to move it around.
There NEEDs to be a way around this limitation. Please let me know if you have a solution or workaround other than changing the package name and paths.

Accepted Answer

Hari Krishna Kakarla
Hari Krishna Kakarla on 7 Oct 2022
Edited: Hari Krishna Kakarla on 7 Oct 2022
Hi Samuel,
I have enabled long paths by following this link: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later and confirmed they are enabled in registry after rebooting the machine. The issue persists after doing this work around as well.
I understand that you don't want to shorten your package names or paths. To work around this issue work in a working directory which is does not have a long absolute path to start with. You can also use a tool like "subst" to map your long path to a drive letter. For example in a Windows cmd.exe prompt run:
subst W: <folder path where your custom message packages exists>
And then in MATLAB use W:\ as your working directory and do ros2genmsg in W:\ drive. That should solve your problem. Incase If the issue still persists, please attach the build log of the ros2genmsg.
Thanks
Hari

More Answers (0)

Categories

Find more on Custom Message Support in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!