Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Failing at SDL

Name: Anonymous 2011-05-27 20:14

>Decide to go do the SDL tutorial on LazyFoo's site
>Type out first tutorial, code looks like so:

#include <SDL/SDL.h>

int main() {

        SDL_Surface* hello = NULL;
        SDL_Surface* screen = NULL;

        SDL_Init( SDL_INIT_EVERYTHING );
        screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
        hello = SDL_LoadBMP( "hello.bmp" );

        SDL_BlitSurface( hello, NULL, screen, NULL );
        SDL_Flip( screen );
        SDL_Delay( 2000 );

        return 0;
}


Compile like so

g++ -framework SDL -o SDLtest test.cc

Get the following linker error:

Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
     (maybe you meant: SDL_main())
ld: symbol(s) not found
collect2: ld returned 1 exit status

ld doesn't know what the fuck main is?

Name: Anonymous 2011-05-27 23:57

>>4
Disregard the autistic people on this board, see http://en.wikipedia.org/wiki/Autism, in short they're unable to understand what it's like for a person who doesn't know any SDL after they have learned it, it's nothing personal, they're actually unable to put themselves in other peoples shoes.

First of all have you installed the SDL development files? >>3 should work for anyone who have them installed.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List