#include <DarkGDK.h>
//constant values
//sprites//
const int PLAY = 1;
const int BUILD = 2;
const int HELP = 3;
//end of sprites//
//menu sprite positioning//
const int PLAYX = 10;
const int PLAYY = 10;
const int BUILDX = 40;
const int BUILDY = 10;
const int HELPX = 70;
const int HELPY = 10;
//end of menu sprite positioning//
//menu sprite image ids//
const int PLAYIMAGE = 1;
const int BUILDIMAGE = 2;
const int HELPIMAGE = 3;
//end of menu sprite image ids//
//end of constant values
//main functions begin
void loadMedia();
void menu();
void game();
void offlineskirmish();
void onlineskirmish(); //the first release will not feature online capabilities.
//end of main functions
//secondary menu functions
void build();
void playmenu();
void helpmenu();
//end of secondary menu functions
//mode handler enum and variable
enum e_GameModes
{
e_Menu,
e_Build,
e_Help,
e_Play
};
int gameMode=e_Menu;
//end of mode handling
void loadMedia()
{
dbLoadImage("play.png", PLAYIMAGE);
dbLoadImage("build.png", BUILDIMAGE);
dbLoadImage("help.png", HELPIMAGE);
}
void menu()
{
dbSprite(PLAY, PLAYX, PLAYY, PLAYIMAGE);
dbSprite(BUILD, BUILDX, BUILDY, BUILDIMAGE);
dbSprite(HELP, HELPX, HELPY, HELPIMAGE);
}
void game()
{
switch (gameMode)
{
case e_Menu:
menu();
break;
case e_Build:
build();
break;
case e_Help:
helpmenu();
break;
case e_Play:
playmenu();
break;
default:
menu();
break;
}
}
void offlineskirmish()
{
}
void onlineskirmish()
{
}
void DarkGDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbSetWindowTitle("FleetWars - v1.0.1");
while (LoopGDK())
{
game();
dbSync();
}
}
produces:
main.obj : error LNK2019: unresolved external symbol "void __cdecl playmenu(void)" (?playmenu@@YAXXZ) referenced in function "void __cdecl game(void)" (?game@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "void __cdecl helpmenu(void)" (?helpmenu@@YAXXZ) referenced in function "void __cdecl game(void)" (?game@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "void __cdecl build(void)" (?build@@YAXXZ) referenced in function "void __cdecl game(void)" (?game@@YAXXZ)
I have no idea what to do. Could it be because I have prototype functions without bodies?
If you can do any models for FW, reply to the FleetWars thread.
Click here!