SDL linking errors with terminal/g++ on OSX lion
===

I installed OSX Lion and Xcode this morning after learning C++ with Sublime Text and Terminal for a little while to use SDL but I'm having some problems when trying to compile in Terminal, here's my code.

    #include "SDL/SDL.h"

    int main(int argc, char* args[])
    {
	    //Start SDL
	    SDL_Init(SDL_INIT_EVERYTHING);

	    //Quit SDL
	    SDL_Quit();

	    return 0;
    }

I put SDL.framework, SDL_mixer.framework and devel-lite into my Library folder and then used Macports to get SDL when that didn't work, the latter hasn't helped.

When I use 'g++ sdltest.cpp -o sdltest -lSDL' I get the following result - 'ld: library not found for -lSDLcollect2: ld returned 1 exit status'. Is there any way I can get this working? 

Also, out of interest, if I were to do a 'clean install' of SDL after formatting my harddrive and reinstalling OSX Lion and XCode (which I'm thinking about doing soon), what would be the best way to go about it? I've ran into errors with all of the guides I've found (it's definitely an issue with me then, I just need to find the easiest one to understand) and a lot of them seem to be tailored to using Xcode rather than a text editor and terminal. Thank you.