September 24th, 2013, 10:12 am
QuoteOriginally posted by: outrunI always get rid of that the few times I code on windows. It's good to clean things up and make it simpler. E.g. you can also say (in this case)int main()instead of int _t main(int argc, _TCHAR* argv[])GUYS, THANKS FOR YOUR KINDNESS AND HELPStill does not compile-----------------------------------//stdfax.h#pragma once#include "targetver.h"#include <stdio.h>#include <tchar.h>// TODO: reference additional headers your program requires here// standard Library#include <stdlib.h>#include <iostream>#include <iomanip>#include <fstream>#include <conio.h> // Supports _getch()//Other Library#include "global.h"------------------------------------//#include "global.h"#ifndef GLOBA_H#define GLOBAL_Hconst char out_file_name[30] = "c:\\out.txt" ;using namespace std;fstream fout(out_file_name );#endif ------------------------------------// main.cpp#include "stdafx.h"using namespace std;int main(int argc,char **argv) { fout << data << "data to global file"; fout.close(); return 0;}=======================================errors reportError 2 error LNK2005: "class std::basic_fstream<char,struct std::char_traits<char> > fout" (?fout@@3V?$basic_fstream@DU?$char_traits@D@std@@@std@@A) already defined in ExSan.obj D:\Mis Documentos\Visual Studio 2012\Projects\ExSan\ExSan\stdafx.obj ExSanError 3 error LNK1169: one or more multiply defined symbols found D:\Mis Documentos\Visual Studio 2012\Projects\ExSan\Debug\ExSan.exe 1 1 ExSan
Last edited by
ExSan on September 23rd, 2013, 10:00 pm, edited 1 time in total.
°°° About ExSan bit.ly/3U5bIdq °°°