Cannot find directories

I've been so frustrated these past few days.

[IMG]http://i818.photobucket.com/albums/zz107/mattttm/screenshots/untitled_zpsa6bbc795.png[/IMG]

I've been getting these errors on two computers through four different compilers.
It seems the directories arnt set up. If that's the cause, I have no clue how to resolve that.

Its a very simple prog too; it just calculates a dist, using dist formula.

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
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;

void calcDistance (int x1, int y1, int x2, int y2);

int main()
{
    int x1, y1, x2, y2;
    cout << "Enter the points in coordinate pair form, ommiting parantheses" << endl;
    cin >> x1 >> y1 >> x2 >> y2;

    calcDistance (x1,  y1,  x2,  y2);

    system("pause");

}


void calcDistance (int x1, int y1, int x2, int y2)
{
    int sideA;
    sideA = x2 - x1;

    int sideB;
    sideB = y2 -y1;

    int sideAsqd;
    sideAsqd = sideA * sideA;

    int sideBsqd;
    sideBsqd = sideB * sideB;

    int sideCsqd;
    sideCsqd = sideAsqd + sideBsqd;

    int dist;
    dist = sqrt(sideCsqd);

    cout << "The calculated distance is "<< dist << endl;

}
Last edited on
closed account (Dy7SLyTq)
link is broken (and we dont have an img tag)
until that, it might be you arent setting up your compiler right
How do i fix it? Google isnt helping.
closed account (Dy7SLyTq)
well your problem is that your using dev-c++ use vs or my personal favorite mingw (well actually its the gnu compiler compository but seeing as you are on windows...) so i would download and install code blocks with mingw
Looks like from the image that the file extension you use is *.c so the compiler is probably compiling as c code, so no <iostream> or <cstdlib>. Change the file extension to cpp.
closed account (Dy7SLyTq)
damn...
You're a genius, naraku9333 !
Topic archived. No new replies allowed.