Devc++_Allegro_HeaderFiles

Im using allegro, and im trying to add a header file to my code, but i get errors such as: [Linker Error] undefined reference to System::System() or [Linker Error] undefined reference to System::~System()

This is the main.cpp:


#include <Allegro.h>
#include "System.h"

int main(){

System system;

system.Setup();

BITMAP *buffer = create_bitmap( 640, 480 );
while ( !key[KEY_ESC] )
{
rectfill( buffer, 0, 0, 640, 480, makecol( 0, 0, 255 ) );
blit ( buffer, screen, 0, 0, 0, 0, 640, 480 );
clear_bitmap( buffer );
}
destroy_bitmap( buffer );
return 0;
}
END_OF_MAIN();



And this is the header file:




class System
{
private:
int screenWidth, screenHeight;
bool fullscreen;
public:
System();
~System();
void Setup();
};
void System::Setup()
{
allegro_init();
install_keyboard();
install_timer();
set_color_depth ( 16 );
fullscreen = false;
if ( fullscreen == true )
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
else
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
}




They are both in the same directory, but i don't know much about header files, can anyone tell me whats wrong with my code?
Did you define System::System() and System::~System() ? It doesn't look like you have - if you declare it in your header like that, you have to define it too.
Im rly noob to this header files stuff, how do i define the systems u just said?
I dont understand how the header files work, anyone know about this? Why isnt my code working?
Topic archived. No new replies allowed.