I'm making a game or rather copying it out of the book I am reading. I have been defining the class and declaring the variables/functions in header files "filename.h" and then defining those functions/variables in a "filename.cpp" the same filename of course. Then to include it's code in the main or another headercode file i type #include "filename.h". I get how this works but in my game (that I copied STRAIGHT from the book) it is giving me linking errors:

In file included from c:\docume~1\michael\mydocu~1\games\monsters\main.c pp:1:
c:\docume~1\michael\mydocu~1\games\monsters\ConLib .h:1: warning: `#pragma once' is obsolete
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x31):main.cpp: undefined reference to `ConLib::ConLib(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x48):main.cpp: undefined reference to `ConLib::~ConLib(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x63):main.cpp: undefined reference to `CGame::CGame(ConLib *)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x7a):main.cpp: undefined reference to `CGame::~CGame(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x96):main.cpp: undefined reference to `ConLib::SetTitle(char *)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0xa8):main.cpp: undefined reference to `CGame::GetStatus(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0xc0):main.cpp: undefined reference to `CGame::Process(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0xe8):main.cpp: undefined reference to `CGame::~CGame(void)'
C:\DOCUME~1\Michael\LOCALS~1\Temp\ccCYbaaa.o(.text +0x107):main.cpp: undefined reference to `ConLib::~ConLib(void)'

I have all of the header files and the main.cpp file in the same folder. What's the problem?

And it also says pragma once obsolete? I understand pragma once is used so you don't include the same file over and over again in other files right?

Also, I'm using Dev.

Thanks for anyhelp.

P.S. I didn't put in Game forum because, well, it's more to do with C++ really.