Programming
/usr/local/include/SDL2/SDL_cpuinfo.h:86:10: fatal error: immintrin.h: No such file or directory
by admin on May.05, 2020, under MAC OS X, Programming
Recently received the error message:
/usr/local/include/SDL2/SDL_cpuinfo.h:86:10: fatal error: immintrin.h: No such file or directory 86 | #include <immintrin.h> | ^~~~~~~~~~~~~
This happened when compiling some SDL2 code on macOS Catalina. Remember, starting with Catalina, Apple has removed x86 support and we’re now on a pure x64 operating system.
The file immintrin.h is part of the GCC i386 configuration. Source code: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/immintrin.h
Since we’re on a pure x64 system the solution for this compile error is quite simple:
Edit the file /usr/local/include/SDL2/SDL_cpuinfo.h and comment out or remove this #include. It’s not needed anymore.