Hi, @Galq Dimitrova
Error:
friend std::ostream & operator<<(std::ostream &out, const Stock &s);
std::ostream& operator << (std::ostream& out, Stock& s)
{
out << "\nCode : " << s.getCode();
out << "\nName : " << s.getName();
out << "\nNumber Of Units : " << s.getNoUnits();
out << "\nCost of Unit : " << s.getValuePerUnit();
out << "\nTotal : " << s.calcAmount() << std::endl;
return out;
}
The declaration of the symbol isn't spelled the same as the definition of the symbol. Verify you use the correct spelling and capitalization in both the declaration and the definition, and wherever the symbol is used or called. You could refer to the document: Linker Tools Error LNK2019.
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.