Two Errors when i try to compile =
LNK2001: unresolved external symbol "struct s_World * w_areas" (?w_areas@@3PAUs_World@@A)
LNK1120: 1 unresolved externals
Here's the code I have so far:
#include "stdafx.h"
#include <iostream>
#include "windows.h"
using namespace std;
///////////////////////////////////////////////////////////////////////////
struct s_World
{
int m_world_area;
int m_world_boundary;
};
struct s_Area
{
int m_area_room;
int m_area_other;
int m_area_boundary;
};
struct s_Room
{
int m_room_xyCoord;
int m_room_object;
int m_room_box;
};
struct s_Box
{
int m_box_desription;
int m_box_puzzle;
};
struct s_Puzzle
{
int m_puzzle_description;
int m_puzzle_clue;
int m_puzzle_collectable;
};
struct s_Player
{
int m_player_backpack;
int m_player_notebook;
int m_player_location;
int m_player_number;
};
//////////////////////////////////////////////////////////////////////////
s_World w_areas [];
s_World w_boundaries[];
s_Area a_rooms[];
s_Area a_others[];
s_Area a_boundaries[];
s_Room r_contents [] =
{
{10, -1, -1,},
{20, 1, -1,},
{30, 1, 1,},
{40, -1, 1,}
};
s_Box bx_descriptions[];
s_Box bx_puzzles[];
s_Puzzle puz_descriptions[];
s_Puzzle puz_clues[];
s_Puzzle puz_collectables[];
s_Player bpk_inventories[];
s_Player nbk_inventories[];
s_Player plr_number[];
s_Player plr_location[];
s_Player plr_turns[];
//////////////////////////////////////////////////////////////////////////////
int main()
{
for(int i=0; i<100; i++)
{
cout << w_areas[i].m_world_area << ' ' ;
if (w_areas[i].m_world_area <= 25)
cout << "You are in Upper World.\n";
else if (26 <= w_areas[i].m_world_area <= 50)
cout << "You are in Northern World .\n";
else if (51 <= w_areas[i].m_world_area <= 75)
cout << "You are in Southern World.\n";
else if (76 <= w_areas[i].m_world_area <=100)
cout << "You are in lower World.\n";
else cout<< "You are lost.\n";
}
for (int i=0; i<4; i++)
{
cout << r_contents[i].m_room_xyCoord << ' '
<< r_contents[i].m_room_object << ' '
<< r_contents[i].m_room_box << endl;
if (r_contents[i].m_room_xyCoord == 10)
cout << "You are in the kitchen.\n";
else if (r_contents[i].m_room_xyCoord == 20)
cout << "You are in the basement.\n";
else if (r_contents[i].m_room_xyCoord == 30)
cout << "You are in the living room.\n";
else if(r_contents[i].m_room_xyCoord == 40)
cout << "You are in the bathroom.\n";
else if(r_contents[i].m_room_xyCoord == 50)
cout << "You are in the garage.\n";
else
cout << "Neither you or I know where you are.\n";
if (r_contents[i].m_room_object == 1)
{
cout << "There is an object in the corner.\n";
}
if (r_contents[i].m_room_box == 1)
{
cout << "There is a box in the corner.\n";
}
}
system("pause");
return 0;
}

New Topic/Question
Reply



MultiQuote




|