Wow! Epic are really themselves in this issue! Not resolving, not answering since 2015, not acting responsibly. Well, what did we expect…
The solution (graceful one, not involving modifications inside PxUnixIntrinsics.h and working in UE4.16.3):
Go to the file, where you include your PhysX headers (#include “ThirdParty/PhysX/PhysX_whatever_version/Include/your_px_header.h”). Just above the include statements add next code:
#if PLATFORM_ANDROID
#include <cmath>
static bool EpicShouldFixThis(float v) {
return std::isfinite(v);
}
static bool EpicShouldFixThis(double v) {
return std::isfinite(v);
}
#define isfinite(x) EpicShouldFixThis(x)
#endif
Then, immediately after the include lines of your PhysX headers add next lines:
#if PLATFORM_ANDROID
#undef isfinite
#endif
That’s it. This should work.
The long and boring explanation (omit this, if you are not interested in the reasons for the issue):
You see, there are several libraries containing isfinite(), since it is a very basic function verifying “finiteness” of the number. Now, one could include it like that for example: extern “C” { bool isfinite(); }. This means “Use native C function”. Or like that: #include <math> and then use std::isfinite(whatever). Apparently Android SDK uses only first example, and PhysX expects the second. So, trivial assumption could be that the only thing needed is to include cmath. But no. Maybe Android SDK cuts it off somewhere, i don’t know. But including will not work. However, if you will not use the #undef after the includes in my fix above, your packaging will crush on multiple definition of isfinite (curses!). That’s the reason i complain about Epic! They are actually including it somewhere! It’s only about #include order. And even if there is no good way to reorder it, my fix should be implemented on their side. All i actually do, is temporarily appointing isfinite calls to std::isfinite, like PhysX wants it. I would even dare to say, that it’s Epic’s responsibility to manage PhysX versions, and make some include adapter governed by macros, and not just throw upon the developer to include the latest PhysX every time they will again secretly decide to jump up a version.