Gosh I hate this message. I'm getting tired of seeing this message, finding the solution, and then forgetting all over again. Specifically, here's the message:
Like I said, I've had this message before and fixed it but I just can't remeber what I did. Here's the situation for this particlar problem:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_ifstream<char,struct std::char_traits<char>
>::basic_ifstream<char,struct std::char_traits<char> >(char const *,int)" (__imp_??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z) referenced in function
I'm writing a class (BTW, I'm writing a windowed application, so don't complain about what I've included ). Some_Class.h:
I define the functions in Some_Class.cpp:
bool SomeFunction(std::string fileName);
The first line (where I declare the ifstream) is where the error is occuring. Can anyone tell me why? I've tried including all of the same things as Some_Class.h, which didn't work.
bool Some_Class::Some_Function(std::string fileName)
if (in.bad()) return false;
return true; //Of course I'm going to add more here, instead of just returning
I also tried sticking this function in Some_Class.h, which did work! Can someone please explain this to me? I'm getting tired of getting this message. Thanks.