Build failed on macOS 15.4, due to "fp.h" not found

Platform info :

  • Apple Silicon M4
  • macOS SDK 15.4
  • Skia-m102
  • cmake version 4.0.1
  • ninja version 1.12.1

Build Command:

cmake \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=15.4 \
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
  -DLAF_BACKEND=skia \
  -DSKIA_DIR=$HOME/deps/skia \
  -DSKIA_LIBRARY_DIR=$HOME/deps/skia/out/Release-arm64 \
  -DSKIA_LIBRARY=$HOME/deps/skia/out/Release-arm64/libskia.a \
  -DPNG_ARM_NEON:STRING=on \
  -G Ninja \
  ..

Error info:

FAILED: third_party/libpng/scripts/intprefix.out /Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out
cd /Users/kcn/Downloads/aseprite/build/third_party/libpng && /opt/homebrew/bin/cmake -DINPUT=/Users/kcn/Downloads/aseprite/third_party/libpng/scripts/intprefix.c -DOUTPUT=/Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out -P /Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/genout.cmake
In file included from /Users/kcn/Downloads/aseprite/third_party/libpng/scripts/intprefix.c:21:
/Users/kcn/Downloads/aseprite/third_party/libpng/scripts/../pngpriv.h:524:16: fatal error: ‘fp.h’ file not found
524 | # include <fp.h>
| ^~~~~~
1 error generated.
CMake Error at scripts/genout.cmake:78 (message):
Failed to generate
/Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out.tf1

1 Like

I’ve recently started migrating my development workflow to macOS and am still familiarizing myself with its build toolchain. While troubleshooting a compilation error related to the missing fp.h header, I discovered through external resources that this issue might stem from macOS SDK versions deprecating or excluding fp.h in newer releases.

Given that this file appears to be part of the legacy CarbonCore framework, could you advise on:

  1. Workarounds to resolve the fp.h dependency (e.g., explicit framework linking, header path adjustments).
  2. Project-specific optimizations to modernize the build process and avoid reliance on deprecated components?

Any insights or documentation pointers would be greatly appreciated!

Hello, did you manage to find any fix ? I am at my wits end, tried 3 different tutorials but i always get stuck here at missing fp.h at line 524 :frowning: any help appreciated. Macbook air m3

I MANAGED TO FIX IT!! I simply changed the line 524 from <fp.h> to <math.h> and it ninja command compiled and produced exectuables in bin.

Thanks for sharing this fix! I’ll try this later.

1 Like

Fixed using these steps:

1 Like

@filtom2 , excellent fix man! Worked for me too on another project. you saved my arse! :sweat_smile:

Good catch. The fact that replacing fp.h with math.h resolved the issue suggests that the project was relying on a legacy header that is no longer available in newer macOS SDKs. As Apple continues to modernize its toolchain, older Carbon and legacy framework dependencies can cause build failures when compiling on recent macOS versions. For anyone troubleshooting similar compiler and header issues, Apple’s Developer Documentation is often the best place to verify API and SDK changes. I also found this overview of C Programming Concepts useful for understanding standard headers and language fundamentals that frequently come up when porting older codebases. In general, replacing deprecated dependencies with standard library equivalents, where possible, tends to be the most future-proof approach.