Problems with SDL (LNK1561)
Hi everyone!
I've been reading SDLtutorials.com and now I'm learning the "Per pixel Collision" tutorial but whenever I try to Build my programs it comes out with a LNK5161 error..
Here is the code:
game.h
Code:
#ifndef GAME_H
#define GAME_H
#include "SDL.h"
class game
{
public:
game();
~game();
void onexecute();
void onthink();
void onupdate();
void onrender();
private:
int screenwidth;
int screenheight;
int screenbbp;
Uint32 screenflags;
bool done;
double thistime;
double lasttime;
double deltatime;
SDL_Surface* screen;
SDL_Event event;
};
#endif
Game.cpp
Code:
#include "Games.h"
game::game()
{
screenwidth=800;
screenheight=600;
screenbbp=32;
screenflags=SDL_HWSURFACE | SDL_DOUBLEBUF;
thistime=0.0;
lasttime=0.0;
deltatime=0.0;
done=false;
SDL_Init(SDL_INIT_EVERYTHING);
SDL_WM_SetCaption("SDL Per Pizel Collision", NULL);
SDL_ShowCursor(0);
screen=SDL_SetVideoMode(screenwidth, screenheight, screenbbp, screenflags);
}
game::~game()
{
SDL_Quit();
}
void game::onexecute()
{
while(!done)
{
onthink();
onupdate();
onrender();
}
}
void game::onthink()
{
while(SDL_PollEvent(&event))
{
if(event.type==SDL_QUIT)
done=true;
if(event.type==SDL_KEYDOWN)
if(event.key.keysym.sym==SDLK_ESCAPE)
done=true;
}
}
void game::onrender()
{
SDL_FillRect(screen, NULL, 0);
SDL_Flip(screen);
}
int main(int argc, char* args[])
{
game game;
game.onexecute();
return 0;
}
Log
Code:
1>------ Build started: Project: re-write SDL pre pixel collision, Configuration: Debug Win32 ------
1> game.cpp
1>LINK : fatal error LNK1561: entry point must be defined
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any ideas?
Thanks for reading!:D