hi,
the program below is a very simple conversion program. the logic is correct and it compiles fine but i get a link error in both win32 (vc++) and linux:
--------------------Configuration: conv - Win32 Debug--------------------
Linking...
conv.obj : error LNK2001: unresolved external symbol "void __cdecl output(double &,double &)" (?output@@YAXAAN0@Z)
Debug/conv.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
conv.exe - 2 error(s), 0 warning(s)
--------------------Configuration: conv - Win32 Debug--------------------
can someone tell me what the error means?
thanks,
barneygumble742
Code:----- #include <iostream> #include <cmath> using namespace std; const int INCHES_PER_FOOT = 12; const int C_METERS_PER_METER = 100; const double METERS_PER_FOOT = 0.3048; void input(double &feet, double &inches); void convert(double &input_one, double &input_two); void output(double &meters, double &c_meters); int main() { double feet, inches, meters, c_meters; input(feet, inches); convert(feet, inches); meters=feet; c_meters=inches; output(meters, c_meters); return 0; } void input(double &feet, double &inches) { cout << "Feet : "; cin >> feet; cout << "Inches: "; cin >> inches; } void convert(double &input_one, double &input_two) { double feet, inches; feet = input_one; inches = input_two; input_one = ( ( inches / INCHES_PER_FOOT ) + feet ) * METERS_PER_FOOT; input_one = floor( input_one ); input_two = abs ( input_one - input_two ) * 100; } void output(int &meters, int &c_meters) { cout << "Meters : " << meters << endl; cout << "Centimeters: " << c_meters << endl; }



LinkBack URL
About LinkBacks


