After the MacOS 15.4 update, my C++ code, which used to compile perfectly fine on my Homebrew gcc
install, stopped working. After a bit of internet search, it seemed like Apple did something weird with their Clang and that is somehow screwing with how gcc
searches for header files. Based on a comment I cannot find longer, it seemed that reinstalling gcc
should fix the issue, but the following error still lingers at the moment:
/opt/homebrew/Cellar/gcc/14.2.0_1/lib/gcc/current/gcc/aarch64-apple-darwin24/14/include-fixed/_stdio.h:90:10: fatal error: _printf.h: No such file or directory
90 | #include <_printf.h>
I'm not sure how to continue from here. Could I please receive some guidance? Thanks!
The correct solution seems to be to install gcc again. brew reinstall gcc
somehow does not do the trick, but brew uninstall gcc
, followed by brew install gcc
does. I assume this runs the mkheader
script mentioned in the comment by this user as well.