I am new to C++ Programming, and I initially learned my basics in VS 2010. I upgraded to VS2013, and I tried to declare my ifstream/ofstream
variables. It would fail to build my program until I either deleted or commented them out.
The code below is just the header file which I'm defining a class which I intend to inherit and save variables from a parent class (character). All of the following includes are in my CPP.
Thanks to those already answered, I removed the istream, and my namespace was present, but I failed to mentioned that and I apologize for my lack of clarity. However, the program is still producing the previously noted errors.
#include <iostream>
#include <string>
#include <ctime>
#include <limits>
#include <Windows.h>
#include <cmath>
#include <fstream>
#include <iomanip>
using namespace std;
class saveLoad : public character
{
public:
saveLoad();
void saveGameFunc();
void loadGameFunc();
ifstream loadGame;
ofstream saveGame;
};
The Errors I receive are:
Error 39 error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator > >::operator*(void)const " (??D?$_String_const_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@QBEABDXZ) E:\Text Rpg\Text Rpg\Game.obj Text Rpg
and
Error 40 error LNK1120: 1 unresolved externals E:\Text Rpg\Debug\Text Rpg.exe 1 1 Text Rpg
Can someone please explain to me the proper way to declare/define in-file and out-file in VS2013?