Hmm.. ok lol, new problem now.
It's a little different than before. The difference here is that the compiler is giving me errors when I try to include my global.h file which conains all of my global variables.
Whenver I include:
"global.h"
in the "intro.cpp" file,
it says its already been defined from cosmosII_client.cpp
error:
Code:
1>intro.obj : error LNK2005: "int arenaGen" (?arenaGen@@3HA) already defined in cosmosII_client.obj
1>intro.obj : error LNK2005: "int arenaTimeNum" (?arenaTimeNum@@3HA) already defined in cosmosII_client.obj
1>C:\Documents and Settings\Keenan\My Documents\Visual Studio 2005\Projects\CosmosII\Debug\CosmosII.exe : fatal error LNK1169: one or more multiply defined symbols found
ect...
But if I take out global.h in the "intro.cpp" file it cant find the variables at all and will say this:
Code:
1>.\intro.cpp(109) : error C2065: 'part' : undeclared identifier
1>.\intro.cpp(123) : error C2065: 'diag_1' : undeclared identifier
1>.\intro.cpp(134) : error C2070: ''unknown-type'': illegal sizeof operand
ect... (it doesnt see the variables in global.h!
WHAT THE FILES LOOK LIKE:
Code:
intro.cpp:
// intro.cpp
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <string.h>
#include <wincon.h>
#include <conio.h>
#include <iostream>
#include <iomanip>
#include "global.h"
#include "color.h"
#include "intro.h"
// prototypes
void main_menu(void); void user_name(void); void difficulty_select(void); void intro(void);
void game_logo(void); void intro_ask(void); void intro_part2(void); void logo(void);
// STARTUP FUNCTIONS:
void logo()
{
dark_logo();system("cls");
for(int intro_loop=0;intro_loop<26;intro_loop++)
{
Sleep(1);
printf("\n\n");
}
} //ect...
Code:
intro.h:
// intro.h
void intro(void);
void game_logo(void);
void intro_ask(void);
void intro_part2(void);
void logo(void);
global.h:
Code:
// global.h
// _________________
// GLOBAL VARIABLES:
extern char diag_1[]="In a galactic system far, far away...";
extern int part=0;
extern char difficultyString[7]="NONE";char typeString[11]="NONE";
extern int difficulty=0,type=0;
//ect...
cosmosII_client.cpp:
Code:
// COSMOS II - CLIENT (Build 0.00)
/* Coded by X
Begun: April 6, 2006 | End: TBA */
#define _WIN32_WINNT WINVER
// include files
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <string.h>
#include <wincon.h>
#include <conio.h>
#include <iostream>
#include <iomanip>
#include "global.h"
#include "color.h"
#include "intro.h"
#ifdef WIN32
#endif
//ect...