The default configuration of Xcode means that #include <math.h> in one of the mupdf headers resolves to fitz/math.h, which causes some very confusing errors. The workaround is to USE_HEADERMAP = NO and make sure include/mupdf/fitz is NOT on the compiler's include path. Arguably Xcode is wrong in this default behaviour, it's also not uncommon for iOS engineers to use recursive includes of the whole project dir which breaks things in the same way. Anyway, I suggest to avoid continual pain for us/customers, rename string.h and math.h (to, say, fits-math.h perhaps).
Fixed in commit 8577a7cf12ccdb258b773a03471663952fd12a4c Author: Tor Andersson <tor.andersson@artifex.com> Date: Fri Jan 13 13:20:59 2017 +0100 Fix 697476: Rename header files. Xcode has an idiotic default configuration where it gets confused by include search paths and file names in projects, so that it will load our "mupdf/fitz/math.h" instead of the system <math.h>. Work around this by renaming header files that have the same base name as a system header (even though they live in a subdirectory, and should never be available directly on the compiler's include path).