Windows PX4 SITL Build Error

I have been attempting to create a JMavSim instance so I can connect to it using pymavlink. I keep getting this error when I run make px4_sitl jmavsim. Does anyone have any idea on how I can fix this?

Total time: 9 seconds
[618/896] Performing install step for ‘libmicroxrceddsclient_project’
– libmicroxrceddsclient_project install command succeeded. See also /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/src/modules/microdds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-install-.log
[715/896] ROMFS: copying, generating airframes
FAILED: etc/init.d/rc.serial etc/init.d/rc.autostart etc/init.d/ ROMFS/romfs_copy.stamp
cd /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/etc && /usr/bin/cmake.exe -E remove_directory /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/etc/
&& /usr/bin/cmake.exe -E tar xf /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/romfs_files.tar && /usr/bin/python3 /cygdrive/c/PX4/home/Firmware/Tools/ --airframes-path /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/etc/init.d --start-script /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/etc/init.d/rc.autostart --board px4_sitl && /usr/bin/python3 /cygdrive/c/PX4/home/Firmware/Tools/serial/ --rc-dir /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/etc/init.d --serial-ports --ethernet --config-files /cygdrive/c/PX4/home/Firmware/src/lib/battery/module.yaml /cygdrive/c/PX4/home/Firmware/src/drivers/gps/module.yaml /cygdrive/c/PX4/home/Firmware/src/drivers/osd/msp_osd/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/control_allocator/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/mavlink/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/microdds_client/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/payload_deliverer/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/sensors/module.yaml /cygdrive/c/PX4/home/Firmware/src/modules/simulation/pwm_out_sim/module_sim.yaml && /usr/bin/cmake.exe -E touch /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/ROMFS/romfs_copy.stamp
CMake Error: cmake version 3.14.5
Usage: /usr/bin/cmake -E [arguments…]
Available commands:
capabilities - Report capabilities built into cmake in JSON format
chdir dir cmd [args…] - run command in a given directory
compare_files [–ignore-eol] file1 file2
- check if file1 is same as file2
copy … destination - copy files to destination (either file or directory)
copy_directory … destination - copy content of … directories to ‘destination’ directory
copy_if_different … destination - copy files if it has changed
echo […] - displays arguments as text
echo_append […] - displays arguments as text but no new line
env [–unset=NAME]… [NAME=VALUE]… COMMAND [ARG]…
- run command in a modified environment
environment - display the current environment
make_directory … - create parent and directories
md5sum … - create MD5 checksum of files
sha1sum … - create SHA1 checksum of files
sha224sum … - create SHA224 checksum of files
sha256sum … - create SHA256 checksum of files
sha384sum … - create SHA384 checksum of files
sha512sum … - create SHA512 checksum of files
remove [-f] … - remove the file(s), use -f to force it
remove_directory dir - remove a directory and its contents
rename oldname newname - rename a file or directory (on one volume)
server - start cmake in server mode
sleep … - sleep for given number of seconds
tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 …]
- create or extract a tar or zip archive
time command [args…] - run command and display elapsed time
touch file - touch a file.
touch_nocreate file - touch a file but do not create it.
create_symlink old new - create a symbolic link new → old

[733/896] Building CXX object src/modules/mavlink/CMakeFiles/modules__mavlink.dir/mavlink_messages.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1

The cygwin toolchain is no longer supported as far as I’m aware. I would recommend to use the Ubuntu toolchain in WSL2 instead.

1 Like

That worked. Thank you!