The fourth parameter depth
can't be NULL. Try changing it to 32.
The function is declared as:
SDL_Surface* SDL_CreateRGBSurface(Uint32 flags,
int width,
int height,
int depth,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask)
See the SDL 2.0 documentation: https://wiki.libsdl.org/SDL_CreateRGBSurface