ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to build ros2 Foxy with Windows Visual Studio Community 2022?

asked 2021-11-15 22:43:04 -0500

Keith G gravatar image

Windows Visual Studio Community 2022 was released a week ago and I cannot find a way to install the 2019 version required to build ros2 Foxy projects.

I have an old machine with 2019 installed and it works fine. But can only get 2022 on my new machine and when I try to build my code all I get is a make file error saying it can't find Windows Visual Studio Community 2019.

I am experienced in embedded C, but not complex projects with build scripts so really don't know where to start.

Thanks,

Keith.

edit retag flag offensive close merge delete

Comments

Have you tried building from aka.ms/ros?

https://docs.ros.org/en/foxy/Installa...

osilva gravatar image osilva  ( 2021-11-16 15:08:03 -0500 )edit

Yes tried this. When I try to build a newly created node I get:

C:\dev_ws>colcon build --merge-install [0.712s] root DEBUG Using proactor: IocpProactor Starting >>> my_package --- stderr: my_package Traceback (most recent call last): File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor__init__.py", line 91, in __call__ rc = await self.task(args, *kwargs) File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task__init__.py", line 93, in __call__ return await task_method(args, *kwargs) File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build rc = await extension.build( File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build rc = await self._reconfigure(args, env) File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 162, in _reconfigure raise RuntimeError(

RuntimeError: Unknown / unsupported VS version '17.0'

Failed <

Keith G gravatar image Keith G  ( 2021-11-19 16:56:19 -0500 )edit

It seems there are only specific version of visual studio supported. I tried adding Visual Studio 17 2022, to the supported list but then get this:

CMake Error: Could not create named generator Visual Studio 17 2022

Generators Visual Studio 16 2019 = Generates Visual Studio 2019 project files. Use -A option to specify architecture. Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.

Keith G gravatar image Keith G  ( 2021-11-19 17:09:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-19 20:14:59 -0500

Keith G gravatar image

Partial answer:

If CMake is updated to the latest version, then new packages can be created and build with VS 2022.

However old packages still can't be re-built as they reference VS 2019 which is no longer available for install from Microsoft.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-11-15 22:43:04 -0500

Seen: 1,078 times

Last updated: Nov 19 '21