I am getting an Unresolved External Symbol compiler error (in VS2013
Express) that I cannot understand. In a common .h file, I have the
following declaration:
template <class T>
string setwLeft(int width, T data); // format w/left & width
template <class T>
string setwRight(int width, T data); // format w/right & width
In its .cpp file, I have defined both functions:
template <class T>
string setwLeft(int width, T data) // format w/left & width
{
ostringstream oss;
oss << left << setw(width) << data;
return oss.str();
}
template <class T>
string setwRight(int width, T data) // format w/right & width
{
ostringstream oss;
oss << right << setw(width) << data;
return oss.str();
}
In my main .cpp files, I reference and use "setwLeft" frequently, but
references to "setwRight" produce the compiler error. What am I doing
wrong? TIA
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com