My main().cpp won't recongnize other .cpp files

This may be an IDE problem(code blocks) and not a coding problem, but hopefully someone can give me a hand. I'm writing a game (with a lot of help from a tutorial) and I can't seem to get my main() to pass off to another part of the program. I have the prototype in a .h file and the compiler isn't complaining, but the program won't run correctly. Here is the code so far:

main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "library.h"

int main()
{
   cout << "\n\n\n\n";
   cout << "WELCOME TO GLADIATORIAL COMBAT\n";
   cout << "written by Dustin Barnett\n\n\n";


   cout << "You wake up to the roar of the crowd." << endl;
   cout << "Your enclosed in a small sandy cell, along with other men." << endl;
   cout << "Your last memory is of the raider decending upon your town\n";
   cout << "Before you can gather your sences, two guards grab you and haul you before a\n";
   cout << "table laden with rusty weapons.\n\n";

 cout << "CHOOSE, shouts a guard\n";
   int wep;

   do{
   cout << "press 1: for sword\n";
   cout << "press 2: for battleaxe\n";
   cout << "press 3: for cestus\n";
   cout << "press 4: for bow and arrow\n\n";

   cin >> wep;
   cout << "\n";
   if(wep == 1)
   cout << "You pick up a battered sword and prepare for whatever is ahead.\n";

   else if(wep == 2)
   cout << "You heft a heavy battleaxe and test it's weight.\n" << endl;

   else if(wep == 3)
   cout << "You slide your hands into the serrated castes and bang the jagged blades together before you.\n" << endl ;

   else if(wep == 4)
   cout << "You grab a bow and arrow and test the draw of the bow.\n" << endl;

   else
   cout << "Yout must choose one of the options above.\n" << endl;
   }while(wep > 4);

   bool Crossroads();






system ("pause");
return 0;
}


library.h
1
2
3
4
#include <iostream>
using namespace std;

#include "global.h" 


global.h
1
2
3
4
5
6
7
8
#ifndef GLOBAL_DEFINE
#define GLOBAL_DEFINE

//PROTOTYPES
bool Crossroads();

#endif


crossroads.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "library.h"

// global varriables
bool shcomplete = false;
bool dfcomplete = false;
bool mcomplete = false;
bool rcomplete = false;
bool ccomplete = false;


bool Crossroads()
{

    int choice = 0;


    while [choice != 10]
    cout << "You stand in the center of a crossroads outside of the small arena town.\n";
    cout << "Where would you like to go.\n\n";

    cout << "EXITS\n";
    cout << "1: Town\n";
    cout << "2: Local Arena\n";
    cout << "3: Surrounding Hills\n";

    if(shcomplete && !dfcomplete)
    cout << "4: Dark Forrest\n";

    if(dfcomplete && !mcomplete)
    cout << "5: Mountains\n";

    if(mcomplete && !rcomplete)
    cout << "6: Roma\n"

    if (rcomplete && !ccomplete)
    cout << "7: Coliseum\n\n"

    cout << "10: exit game\n"

    cout << ">";

    cin >> choice;

    return true;
}


Sry for the legnthy post. I am using this as a last resort, not just asking because i'm momentarily stuck. Thanks for taking a look. I hope it's an easy fix.
bool Crossroads();
The above is just a function declaration, I assume you wanted to call the function: Crossroads();
And I can't see the compiler not complaining about this: while [choice != 10]
Yes, I am trying to call Crossroads with the main function. The compiler isn't even recognizing Crossroads.cpp as part of the program though. I intentionally took out some ';'s to see if the compiler was checking the crossroads.cpp and it isn't. Like I said, I suspect that I am doing something wrong with the IDE because I can't see why the Crossroads function call wouldn't work, because (as far as I can tell) it's prototyped correctly. For some reason there is an * before my Crossraods.cpp file title. It reads *crossroads.cpp. I do not know if that is significant or not though.

btw it should be: while(choice != 10) right?
You forgot to add the file to your project (Project/Add files...).
Always create new files using New/File/Empty file, it will then ask you if you want to add it to the project.
dolp...sry for the nubness. Thanks for the solution.
OK, I have regenerated the Crossroads.cpp file and it is now part of the project, as evidenced by the compiler now pointing out mistakes, but I still cannot get the bool Crossroads() function call to work. The program runs to the end of main, and then exits. Could someone take another look at it please?
You arent't actually calling the Crossroads function. See my first post.
Thanks agan Athar. Sry for not reading closely enought the first time around. I'll be glad when these little beginner mistakes are a thing of the past and I can concentrate on what i'm coding and not how i'm coding.
Topic archived. No new replies allowed.