error LNK2019: unresolved external symbol "public: class Store __thiscall Store::createStore(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?createStore@Store@@QAE?AV1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
and
Error 2 error LNK1120: 1 unresolved externals
I've been googling for hours and trying to test out different ways where the program compiles but I still haven't been able to get it to do what I want.
#include <iostream>
#include <string>
#include "Store.h"
usingnamespace std;
int main()
{
string strUserStore;
cout << "Enter a store" << endl;
cin >> strUserStore;
Store UserStore;
UserStore.createStore(strUserStore); // if I delete this line, it compiles so I think the problem is in the function, but I can't figure out how to fix it.
//I've also tried changing it to UserStore = UserStore.createStore(strUserStore); but it has the same error.
cout << UserStore.strStoreName << endl;
return 0;
}