Hi ,
Working on VC++ 2012.
"error LNK2005: "class std::basic_ofstream<char,struct std::char_traits<char> > Createonly_logs" (?Createonly_logs@@3V?$basic_ofstream@DU?$char_traits@D@std@@@std@@A) already defined in UtilityFunctions.obj
I have defined a text file (for writing the output) under LogFiles.h
using namespace std;
ofstream Createonly_logs("E:\MyProj\MTEST\CreateFile_logs.txt");
I have created three .cpp under the project and all these cpp uses the text file to append the output
Create.cpp (main file)
* i call the functions defined in other 2 .cpp from here , so i add the header file
UtilityFunctions.cpp (only common functions are defined here) but the output is directed to text file , so i use
MemoryCalc.cpp (supports few functions which is called from Create.cpp),
on compiling the code, i get the above error. How to fix this?
Thanks
Ana