hey, i am getting a few errors whenever i try to compile my "game". your example compiles fine, but my own one doesnt.
it says:
Main.obj : error LNK2019: link to not existing external symbol ""public: void __thiscall _FirstPerson::Update(void)" (?Update@_FirstPerson@@QAEXXZ)" in function ""void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)".
Main.obj : error LNK2019: link to not existing external symbol ""public: void __thiscall _FirstPerson::MovementSetup(int,float,int,float,float,float,float,float,int)" (?MovementSetup@_FirstPerson@@QAEXHMHMMMMMH@Z)" in function ""void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)".
Main.obj : error LNK2001: not existing external symbol ""class _FirstPerson FirstPerson" (?FirstPerson@@3V_FirstPerson@@A)".
Debug\basicfps.exe : fatal error LNK1120: 3 links to not existing external symbols.
my game code is:
#include "DarkGDK.h"
#include "SC_Collision.h"
#include "First Person.h"
//declaring values
const int lvl = 1;
const int monster = 2;
//declaring functions
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
//starts the SC (sparky's collision)
//and disables the automatic cam repositioning whenever a new object is loaded.
SC_Start ();
dbAutoCamOff();
//Loading Data
dbLoadObject("Atomiser.x", 10);
dbLoadObject("Bezerker.x", 20);
dbLoadImage ("texture.jpg", 30);
dbLoadImage ("detail.jpg", 31);
dbLoadObject ("skybox2.x", 2);
//Positioning the Berzerker.x (ID 20)
dbPositionObject(20, 320, 1, 330);
dbRotateObject (20, -90, 180, 0);
SC_SetupObject (20, monster, 0);
//Positioning the Atomiser.x (ID 10)
dbPositionObject (10, 10, -15, 20);
dbRotateObject (10, -90, 0, 0);
dbLockObjectOn (10);
SC_SetupObject (10, 0, 1);
//Setting up the Terrain (ID 1)
dbSetupTerrain ();
dbMakeObjectTerrain (1);
dbSetTerrainHeightMap (1, "map.bmp");
dbSetTerrainScale (1, 2.0f, 0.3f, 2.0f);
dbSetTerrainLight (1, 1.0f, -0.25f, 0.0f, 1.0f, 0.9f, 0.78f, 0.01f);
dbSetTerrainTexture (1, 30, 31);
dbBuildTerrain (1);
SC_SetupComplexObject (1, lvl, 2);
//Setting up the skybox (ID 2)
dbSetObjectLight (2, 0);
dbSetObjectTexture (2, 3, 1);
dbScaleObject (2, 5000, 5000, 5000);
dbPositionCamera (330, 5, 330);
FirstPerson.MovementSetup (33, 50.0, lvl, -0.2f, 0.5f, 0.3f, 5.0f, 4.0f, 5);
while ( LoopGDK ( ) )
{
//display camera position
char camx [128];
sprintf_s (camx, 128, "Cam X Pos: %f", dbCameraPositionX (0));
dbText (0, 0, camx);
char camy [128];
sprintf_s (camy, 128, "Cam Y Pos: %f", dbCameraPositionY (0));
dbText (0, 20, camy);
char camz [128];
sprintf_s (camz, 128, "Cam Z Pos: %f", dbCameraPositionZ (0));
dbText (0, 40, camz);
//display FPS
char fps [128];
sprintf_s (fps, 128, "FPS: %d", dbScreenFPS ());
dbText (0, 60, fps);
// update the screen
dbUpdateTerrain ();
FirstPerson.Update ();
dbSync ( );
}
return;
do you know what the problem might be?
regards