Original Post
Why do I get a link error with this code: [link error] undifined refenrence to 'SDL_main' [build error] [SDLProject1.exe] Error 1 I linked the following files and normaly it works fine (with other codes) libmingw32.a libSDLmain.a libSDL.a so It's something in my code I guess but I don't know what :(
#include <SDL/SDL.h>
#include <cstdlib>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
cout << "Error" << endl;
return 1;
}
atexit(SDL_Quit);
SDL_Surface *screen;
screen = SDL_SetVideoMode(800,600,0,SDL_HWSURFACE|SDL_DOUBLEBUF);
return 0;
}