J
John J
I've written the following code to return the negative of a class object:
Length Length:perator - ()
{
return Length (-nu, me);
}
The "nu" is an int and the "me" is a string. I use the following line of
code to test the function.
cout << "The negative of Length a is " << -a <<endl;
"a" is a Length object in the form of Length a (30, cm)
When I try to compile I get the following error.
Length.obj : error LNK2019: unresolved external symbol "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
operator<<(class std::basic_ostream<char,struct std::char_traits<char> >
&,class Length const &)"
(??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABVLength@@@Z)
referenced in function _main
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
I've tried everything I can to resolve this problem, but I can't seem to fix
it.
Tks for any help
Length Length:perator - ()
{
return Length (-nu, me);
}
The "nu" is an int and the "me" is a string. I use the following line of
code to test the function.
cout << "The negative of Length a is " << -a <<endl;
"a" is a Length object in the form of Length a (30, cm)
When I try to compile I get the following error.
Length.obj : error LNK2019: unresolved external symbol "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
operator<<(class std::basic_ostream<char,struct std::char_traits<char> >
&,class Length const &)"
(??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABVLength@@@Z)
referenced in function _main
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
I've tried everything I can to resolve this problem, but I can't seem to fix
it.
Tks for any help