January 6th, 2013, 04:31 PM
linking error? I just started learning C++...
So I just downloaded DEVc++, just using an example my teacher has given during class to check if it works. Now that it didn't work and I don't know why. I tried to looking for answers about linking error online, but I can't understand the answers.
So here is the program:
//Program to convert from Fahrenheit to Celcius
double fahrenToCelsius (double t);
//t is a valid tempreture in Fahrenheit
//returns equivalent temp. in Celcius
int main ()
using namespace std;
cout<< "Enter temp. in degrees Fahrenheit. ";
cin >> f;
cout<< f << "in degs. Fahrenheit = "
<< fahrenToCelsius (f) << "in degs. Celcius" ;
double fahrenToCelcius (double t)
And here is the problem:
[Linker error] C:\Users\Owner\AppData\Local\Temp\cckex8SZ.o:fahrenToCelsius.cpp: (.text+0x3d): undefined reference to `fahrenToCelsius(double)'
collect2: ld returned 1 exit status
I'm suspecting the program maybe that I saved it wrong? I saved it as fahrentoCelsius.cpp inside the folder "Work" ( I created this folder) which is inside the folder "Dev-cpp".
Tags for this Thread
Click Here to Expand Forum to Full Width