Including SDL2 to two files; error: expected ‘,’ or ‘;’ before ‘extern’

I’m using g++ compiler with c++ 17 standard on Debian 9 to write an game engine. I have two simple objects which functionality is divided in to two files: game.cpp and render.cpp. I include SDL2 library in both of them, also game.cpp is including render.h which is using render.cpp.

The code is working separate from SDL but seems I mess up something with including order. The compiler gives me two errors:

In file included from /usr/include/SDL2/SDL_config.h:33:0,
                 from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ../src/render.cpp:4:
/usr/include/SDL2/SDL_platform.h:169:1: error: expected ‘,’ or ‘;’ before ‘extern’
 extern "C" {
 ^~~~~~
In file included from /usr/include/SDL2/SDL_config.h:33:0,
                 from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ../src/game.cpp:5:
/usr/include/SDL2/SDL_platform.h:169:1: error: expected ‘,’ or ‘;’ before ‘extern’
 extern "C" {
 ^~~~~~

Line 4 and 5 is simply #include "SDL2/SDL.h".

Do you include anything before SDL.h? That extern is the first thing in the preprocessed output from the SDL headers. Perhaps something in front of it causes the error.

You could also check if clang gives a better error message. It does for me with this example:

int x = 0
#include <SDL.h>

int main(int argc, char**argv)
{
    return 0;
}