error LNK 2019 unresolved external symbol
Mar 14, 2014 at 3:10pm UTC
How do I resolve this error LNK 2019? I think it means the compiler cannot find something........1>measurement.obj : error LNK2019: unresolved external symbol "public: void __thiscall measurement::output(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?output@measurement@@QAEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function _main
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
#include <iostream>
using namespace ::std;
class measurement
{
public :
// Constructors
measurement(void );
measurement(int y , int f, int i);
// Mutator Functions
void setYards(int );
void setFeet(int );
void setInches(int );
// Accessor Functions
int getYards(void );
int getFeet(void );
int getInches(void );
// Other Functions
void advanceOneInch();
// increase the inches amount by 1
// NOTE: you may have to advance the feet
// you may have to advance the yards
void output(ostream &);
void zeroOut(void ); // set yards, feet and inches to 0
private :
int yards;
int feet;
int inches;
};
void main()
{
measurement stackOfLumber(3,2,5);
for ( int i = 1; i <= 200; i++)
{
stackOfLumber.advanceOneInch();
stackOfLumber.output(cout);
}
stackOfLumber.zeroOut();
stackOfLumber.output(cout);
stackOfLumber.setYards(6);
stackOfLumber.setFeet(2);
stackOfLumber.setInches(3);
cout << stackOfLumber.getYards() << ' '
<< stackOfLumber.getFeet() << ' '
<< stackOfLumber.getInches() << endl;
return ;
}
measurement::measurement (void )
{
yards=3;
feet=2;
inches=5;
}
measurement::measurement (int y, int f, int i)
{
yards=y;
feet=f;
inches=i;
}
void measurement::setYards (int y)
{
yards=y;
}
void measurement::setFeet (int f)
{
feet=f;
}
void measurement::setInches (int i)
{
inches=i;
}
int measurement::getInches (void )
{
return inches;
}
int measurement::getYards (void )
{
return yards;
}
int measurement::getFeet (void )
{
return feet;
}
void measurement::advanceOneInch()
{
inches++;
if (inches>11)
{
feet++;
inches=0;
}
if (feet>2)
{
yards++;
feet=0;
}
}
void measurement::zeroOut(void )
{
inches=0;
feet=0;
yards=0;
}
Last edited on Mar 14, 2014 at 3:11pm UTC
Mar 14, 2014 at 3:30pm UTC
Line 50. Tell me where is body of output function located?
Topic archived. No new replies allowed.