Oct 5, 2013 at 7:11pm UTC
I've been so frustrated these past few days.
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.
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>
using namespace std;
void calcDistance ( int x1, int y1, int x2, int y2);
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);
void calcDistance ( int x1, int y1, int x2, int y2)
sideA = x2 - x1;
sideB = y2 -y1;
sideAsqd = sideA * sideA;
sideBsqd = sideB * sideB;
sideCsqd = sideAsqd + sideBsqd;
dist = sqrt(sideCsqd);
cout << "The calculated distance is "<< dist << endl;
Last edited on
Oct 5, 2013 at 7:20pm UTC
Oct 5, 2013 at 7:38pm UTC
link is broken (and we dont have an img tag)
until that, it might be you arent setting up your compiler right
Oct 5, 2013 at 8:05pm UTC
How do i fix it? Google isnt helping.
Oct 5, 2013 at 8:17pm UTC
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
Oct 5, 2013 at 8:20pm UTC
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.
Oct 5, 2013 at 9:02pm UTC
You're a genius, naraku9333 !