I'm trying to learn SDL with the cone3d tutorials, and after reading and typing the first two tutorials, I decided to try to make my own framework to better understand it.
Thing.cpp is the name of the file.
#include <SDL/SDL.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
//Throw up the Video and Audio
void setup()
{
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)<0)
{
cout << "Unable to r0xx0r." << SDL_GetError();
system("PAUSE");
return;
}
atexit(SDL_Quit);
//Set up the drawing surface.
SDL_Surface *screen;
SDL_Surface *icon;
screen = SDL_SetVideoMode(640,480,32, SDL_HWSURFACE|SDL_DOUBLEBUF);
}
int main()
{
setup();
system("PAUSE");
return 0;
}
Now, when I compile, I get the following error messages:
2 C:\APPLICATIONS\DEV-CPP\include\c++\3.3.1\backward\iostream.h:31, from Thing.cpp In file included from C:/APPLICATIONS/DEV-CPP/include/c++/3.3.1/backward/iostream.h:31, from Thing.cpp
2 C:\Applications\Dev-CPP\Programs\SDL\Thing.cpp from Thing.cpp
2 C:\APPLICATIONS\DEV-CPP\include\c++\3.3.1\backward\backward_warning.h:32 #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
C:\APPLICATIONS\DEV-CPP\lib\libSDLmain.a(SDL_win32_main.o.b)(.text+0x3bd) In function `console_main':
[Linker error] undefined reference to `SDL_main'
C:\APPLICATIONS\DEV-CPP\lib\libSDLmain.a(SDL_win32_main.o.b)(.text+0x3bd) In function `console_main':
[Linker error] undefined reference to `SDL_main'
Any ideas as to what I might be doing wrong?
---There are 2 kinds of people: those who know hexadecimal, and those who don't.