About Store Forum Documentation Contact



Post Reply 
Newbie Help!
Author Message
atarax Offline
Member

Post: #1
Newbie Help!
Hi I am new to the engine and was running though how the states were setup.

I am trying to get them to work in my application but I am receiving linker errors.

The error i get is

Code:
1>------ Build started: Project: TheHunted, Configuration: Debug Win32 ------
1>Compiling...
1>IntroState.cpp
1>Linking...
1>Main.obj : error LNK2001: unresolved external symbol "struct EE::State IntroState" (?IntroState@@3UState@EE@@A)
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "bool __cdecl Main(void)" (?Main@@YA_NXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "void __cdecl Draw(void)" (?Draw@@YAXXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>TheHunted.exe : fatal error LNK1120: 3 unresolved externals


My Code is

Code:
#include "stdafx.h"
#include "Main.h"

static Bool IntroUpdate()
{
//if any of these keys are pressed changed the state to the gamestate and fade 1.0 seconds
//if (Kb.bp(KB_ESC) || Kb.bp(KB_ENTER) || Kb.bp(KB_SPACE) || Ms.b(0))
//StateGame.set(0.5);

return true;

}

static void IntroDraw()
{

D.clear();

}


//pass the IntroState Constructor the functions in order

State StateIntro(IntroUpdate,IntroDraw);


I have it doing StateIntro.set() from the Main state so it switches to it....
I also checked my linker settings to make sure they were the same as the bloody massacre source
09-30-2009 01:59 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Newbie Help!
you look for:
unresolved external symbol "struct EE::State IntroState"

but you have:
State StateIntro(IntroUpdate,IntroDraw);
09-30-2009 12:39 PM
Find all posts by this user Quote this message in a reply
atarax Offline
Member

Post: #3
Re: Newbie Help!
hey thanks for the response, i actually noticed that after i posted last night...
I changed it but still am getting 2 linker errors

Code:
1>------ Build started: Project: TheHunted, Configuration: Debug Win32 ------
1>Compiling...
1>IntroState.cpp
1>Linking...
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "bool __cdecl Main(void)" (?Main@@YA_NXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "void __cdecl Draw(void)" (?Draw@@YAXXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>TheHunted.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\esenthel\TheHunted\TheHunted\Debug\BuildLog.htm"
1>TheHunted - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Looks like its something with "StateMain" but I never created one? Is this an engine default state?
09-30-2009 04:41 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Newbie Help!
check the tutorials, (there is a tutorial for states)

Main and Draw must always be defined
09-30-2009 05:43 PM
Find all posts by this user Quote this message in a reply
atarax Offline
Member

Post: #5
Re: Newbie Help!
Thanks for the help its working now smile
09-30-2009 11:41 PM
Find all posts by this user Quote this message in a reply
Post Reply