I'm creating this class:
///> MyObject.h file
class __declspec(dllexport) CMyObject
{
public:
int m_Intero;
public:
CMyObject();
~CMyObject();
public:
friend std::wifstream& operator>>(std::wifstream& is, CMyObject& eprt);
}
///> MyObject.cpp
std::wifstream& operator>>(std::wifstream& is, CMyObject& myobj)
{
if (is.is_open())
///> Input operations.
return is;
}
When I compile the library I get no errors, but when I use my library in the final project I get this error:
LNK2019 unresolved external symbol reference "class std::basic_ifstream<wchar_t,struct std::char_traits<wchar_t> > & __cdecl operator>>(...) in function "public: void __thiscall ...
I guess I have to specify somehow that my operator>> function have to be exported.
How should I modify my code?
Few aspects:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With