IDE Compiling Issues

Hello everyone. I am looking at a Beginning C++ Game Programming book, and it has been talking about the Arithmetic Operators. I copy the code from the book and write it out into the Dev-C++ 4.9.9.2. IDE. Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;

int main()
{
    cout  << "7 + 3 = " << 7 + 3 << endl;
    
    cout << "7 - 3 = " << 7 - 3 << endl;
    
    cout << "7 * 3 = " << 7 * 3 << endl;
    
    cout << "7 / 3 = " << 7 / 3 << endl;
    
    cout << "7.0 / 3.0 = " << 7.0 / 3.0 << endl;
    
    cout << "7 % 3 = " << 7 % 3 << endl;
    
    cout << "7 + 3 * 5 = " << 7 + 3 * 5 << endl;
    
    cout << "(7 + 3) * 5 = " << (7 + 3) * 5 << endl;
    
    cin.get();
    return 0;   
}


Here is the error that shows up.

C:\Users\Sinclair\Documents\Adam's Stuff\Game Programming\Makefile.win [Build Error] No rule to make target `C:/Program', needed by `calculator.o'. Stop.

Any attempt to help would be much appreciated!
Oho, Dev-C++ now can't use its own makefiles? Hehehehehe...

Upgrade your IDE and compiler. If you want to stick to something close to Dev-C++, try wxDev-C++ (which I think comes bundled with a much newer version of MinGW). Code::Blocks is another good IDE that some would recommend highly, and it also comes bundled with MinGW.

I personally use Eclipse, but its not necessarily very beginner friendly.

Happy coding!

-Albatross
Albatross thankyou very much. I luckily had wxDev-C++ on my computer from before and I copied and pasted (although I agree its' frowned upon) the code into the IDE.

After pressing F9 the program worked and I could see my math equations.

Thankyou very much!
Actually I am having another problem...

Using the wxDev-C++ IDE, I put in this code:

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
#include <iostream>
using namespace std;

int main()
{
    int score;
    double distance;
    char playAgain;
    bool shieldsUp;
    
    short lives, aliensKilled;
    
    score = 0;
    distance = 1200.76;
    playAgain = 'y';
    shieldsUp = true;
    lives = 3;
    aliensKilled = 10;
    
    double engineTemp = 6572.89;
    
    cout << "\nscore: "     << score << endl;
    cout << "distance: "    << distance << endl;
    cout << "playAgain: "   << playAgain << endl;
    //skipping shieldsUp since you don't generally print Boolean values.
    cout << "lives: "       << lives << endl;
    cout << "aliensKilled: " << aliensKilled << endl;
    cout << "engineTemp: " << engineTemp << endl;
    
    int fuel;
    cout << "\nHow much fuel? ";
    cin >> fuel;
    cout << "fuel: " << fuel << endl;
    
    typedef unsigned short int ushort;
    ushort bonus = 10;
    cout << "\nbonues: " << bonus << endl;
    
    cin.get();
    return 0;   
}


This error then pops up:

1
2
3
4
multiple definition of `main'
first defined here
ld returned 1 exit status
C:\Users\Sinclair\Documents\Adam's Stuff\Game Programming\Makefile.win [Build Error]  [Default] Error 1
Topic archived. No new replies allowed.