Can't get latest SDL to work

Hey, I’m having problems getting latest SDL working. I ran ./configure; make; make install and when it finished installing, I ran clang test.c -I/usr/local/include/SDL2 -L/usr/local/lib -l:libSDL2.a -lm but it would give this wall of errors:
Here’s the C code:

#include <unistd.h>
#include "SDL.h"
#include "SDL_hints.h"
#include "SDL_version.h"

int main(int argc, char *argv[])
    // Testing if I did everything properly
    SDL_version compiled;
    SDL_version linked;

    printf("We compiled against SDL version %d.%d.%d ...\n",
            compiled.major, compiled.minor, compiled.patch);
    printf("But we are linking against SDL version %d.%d.%d.\n",
            linked.major, linked.minor, linked.patch);
	return 0;

	if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
		printf("error initializing SDL: %s\n", SDL_GetError());
	printf("Le hint: %s\n", SDL_GetHint(SDL_HINT_X11_WINDOW_TYPE));
	SDL_Window *myDockWindow = SDL_CreateWindow("Dock Window", 100, 100, 100, 100, 0);


	return 0;

It seems like it’s having problems linking necessary libraries, but I’m new to C and the linkers concept so I’m not sure how to fix it.

If you’re not going to use pkgconfig to get linker flags, you have to do them all yourself.
Better to use pkgconfig.

At a minimum, it looks like you’re missing -ldl .

Looks like they’re also missing -lm

Definitely compile with clang test.c -o test `sdl2-config --cflags --libs` instead of manually specifying everything