cygwin: failed to build ArduPilot because of isnan / isinf

Upon building SITL on Windows 10 via cygwin following this tutorial: Setting up SITL on Windows, I encountered build error in this step :

Something like these (the original error is very long):

So, it seems the libraries is trying to use isnan function but can’t find it.
The solution is quite simple (although I’m not sure if it’s the correct way, but hey.. my solution works!): we edit all .cpp and .h files inside ardupilot/libraries/ folder (and subfolders) and replace all isnan and isinf appearance into std::isnan and std::isinf, for example inside ardupilot/libraries/AP_AHRS/AP_AHRS.cpp line #271, replace:


to find files that references isnan and isinf, you can use find command (from within ardupilot/libraries/ folder) like this one:

find all .h and .cpp files that contain "isnan" reference

find all .h and .cpp files that contain “isnan” reference

and for isinf:

It’ll show you the files that need to be edited. (You might need to install nano to edit the files — just for convenience).

And done! You are good to go to build SITL in Windows!!

SITL running in windows 10 64bit

SITL running in windows 10 64bit

Leave a Reply

%d bloggers like this: