> Mistake 2: Including SDL2/SDL.h
The overarching mistake here is not using a proper build toolchain (build system and package manager). I especially take issue with this assertion:
> The correct SDL2 include is the following:
> #include "SDL.h"
Including headers with the library prefix (#include <SDL2/SDL.h>) is our only hope to have an inter-operable ecosystem of C/C++ libraries. Let me illustrate this with a concrete example. What the article suggests is having the header search path (i.e., -I option from sdl2-config) pointing to the location of the SDL.h header (say, /usr/include/SDL2). But there are other headers[1]in there. Thankfully, most of them have the SDL_ prefix (by all means an exception rather than the rule, when it comes to C/C++ libraries), but not all. For example, there is the generically-named begin_code.h header.
Imagine now that your project is using another library with the same arrangement which also contains a bunch of generically-named headers and one of them happened to be called begin_code.h. Now which one gets picked up depends on the order of the -I options that are passed to the compiler.
[1] https://packages.debian.org/stable/amd64/libsdl2-dev/filelis...