Hi,
i'm having problems getting SDL to work with the Dev-C++ compiler. As soon as i include the sdl.h the compiler gives me a "[Linker error] undefined reference to `WinMain@16'" error. What i do is:
1) File->New->Project->Empty project
2) File->New->Source File->Add it to project
I use this code:
#include <stdio.h>
#include <conio.h>
int main()
{
printf("Blah");
getch();
}
And everything works fine. But when i change it to this:
#include <stdio.h>
#include <conio.h>
#include <sdl\sdl.h>
int main()
{
printf("Blah");
getch();
}
It gives me a "[Linker error] undefined reference to `WinMain@16'" error. I have downloaded the includes and lib's from here:
http://www.libsdl.org/download-1.2.php (the SDL-devel-1.2.7-mingw32.tar.gz (Mingw32) under Win32). Of course i could go with writing a windows application(by using WinMain(...) as the main function) that just uses SDL but what about the portability? Such a program wont be able to run on Linux &stuff, right?. As i understand with SDL you should be able to write an application that runs on any SDL supported OS. So my question is - what am i doing wrong and how should i go about writing an app that runs on many OS and uses SDL?