Goodmorning guys,
I'm trying to compile a simple SDL project with gcc in mac OSX Maverick...
This is my main.c file:

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

int main( int argc, char *argv[])
    return 1;

In facts my function do nothing but I just want to see if I can compile.

So I've tried to compile like that gcc -lSDL -o main main.c, but I get the message:

ld: library not found for -lSDL
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've included SDLMain.h and SDLMain.m files in the same folder of main.c
I've correctly installed SDL framework in /System/Library/Frameworks.
I've searched a lot around internet for a solution but I can't get one, so I ask if you have any suggestion

You can tell gcc specific directories to search for libraries with the -L switch, e.g.


On Linux, you don't have to bother doing all this yourself as there's a helpful expanding config to do it for you that you add to your gcc line; sdl-config --cflags --libs ( ). Is there not something similar for OSX?