Ask Your Question

Cmake error when compiling ros_tutorials packages in windows 10 ROS 2 Foxy Fitzroy Patch Release 4

asked 2021-01-24 20:36:13 -0600

updated 2021-01-25 08:55:32 -0600

I just followed the instructions in Installing ROS 2 on Windows. After that, I tried to create a workspace following this tutorial but at step 5, I'm getting the following error:

C:\dev_ws>colcon build --merge-install
Starting >>> turtlesim
--- stderr: turtlesim
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not find one.

Could not find a package configuration file provided by "Qt5" with any of
the following names:


Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.

Failed <<< turtlesim [1.20s, exited with code 1]

Summary: 0 packages finished [1.39s]
1 package failed: turtlesim
1 package had stderr output: turtlesim

It's weird because on the installing tutorial(binaries) doesn't say anything about extending the variable "CMAKE_PREFIX_PATH" to include the Qt5 directory. Not even in the "Building ROS 2 on Windows" tutorial. I found some Qt folders in the share folder of the zip installation. I'm guessing I don't need to install Qt because the installation already comes with it. Moreover, "CMAKE_PREFIX_PATH" already points to the installation directory: "C:\dev\ros2_foxy" where those Qt folders are.

This is the system I'm using:

Operating System: Windows 10

Installation type: binaries

Version or commit hash: ROS 2 Foxy Fitzroy Patch Release 4

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-01-24 23:59:52 -0600

updated 2021-01-25 00:01:51 -0600

It turns out that in order to fix it I needed to install the Qt win64_msvc2019_64 in C:\Qt. Then, set the variable:

set Qt5_DIR=C:\Qt\5.15.0\msvc2019_64

or set it permanently:

setx -m Qt5_DIR C:\Qt\5.15.0\msvc2019_64

Basically, follow the Building ROS 2 on Windows but only the "Install Qt5" section because there is no Qt win64_msvc2019_64 in C:\dev\ros2_foxy

edit flag offensive delete link more

answered 2021-02-22 06:52:31 -0600

Alternatively I was able to download / install this package for running Foxy on Win10 without any problems:

edit flag offensive delete link more


True but that doesn't fix the issue if you were to follow the instructions in the ROS2 tutorial webpage... by the way, does that install uses Foxy Fitzroy Patch Release 4?

andrestoga gravatar image andrestoga  ( 2021-02-25 00:09:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-01-24 20:36:13 -0600

Seen: 66 times

Last updated: Feb 22