include <fstream.h> 100 errors



  • Hi zusammen

    Ich will 2 Log Files generieren. Hat bis jetzt auch immer geklappt, nur diesesmal nicht.

    Ich hab es mit folgendem code versucht:

    #include <fstream.h>
    
    //-----------------------------------------------------------------------------
    int main(int argc, char* argv[])
    
    {	
    
    	CDateTime dateTime;
    	cout << "*********************************" << endl;
    	cout << "* Welcome to Transit Observator *" << endl;
    	cout << "*          (C) PSND             *" << endl;
    	cout << "*********************************" << endl; 
    
    	string logFileTimeStamp = dateTime.DateTime();
    
    	string errorLogFileName = "errorReport_" + logFileTimeStamp + ".csv";
    	string rawLogFileName	= "raw_"		 + logFileTimeStamp + ".csv";
    
    	cout << errorLogFileName << endl;
    	cout << rawLogFileName << endl;
    
    	ofstream oStreamErrorLog;
    	ofstream oStreamRawLog;
    	oStreamErrorLog.open(errorLogFileName.c_str(), ios::app);
    	oStreamRawLog.open(rawLogFileName.c_str(), ios::app);	
    
            return 0;
    }
    

    leider kommen nun 102 errors:
    **
    Kann mir jemand sagen, was ich falsch gemacht habe? Blicke nicht mehr durch.**
    --------------------Configuration: Transit_Observer - Win32 Debug--------------------
    Compiling...
    main.cpp
    c:\program files\microsoft visual studio\vc98\include\ios.h(146) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(160) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(180) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(207) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(210) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(219) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\streamb.h(90) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\streamb.h(90) : error C2872: 'streamoff' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\streamb.h(91) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\streamb.h(91) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(258) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(258) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(259) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(259) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(260) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(260) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(272) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(272) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(272) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(273) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ios.h(290) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(67) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(74) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(74) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(90) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(102) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(117) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(118) : error C2872: 'streamoff' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(119) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(126) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(132) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(139) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(140) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(140) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(140) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(142) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(143) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(145) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(146) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(148) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(149) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(150) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(152) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(153) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(155) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(156) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(157) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(159) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(161) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(162) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(167) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(169) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(169) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(170) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(170) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(175) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(175) : error C2872: 'istream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(177) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(177) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(178) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(178) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(179) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\istream.h(179) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(62) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(70) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(70) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(87) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(94) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(95) : error C2872: 'streamoff' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(96) : error C2872: 'streampos' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(101) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(107) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(112) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(113) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(113) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(113) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(115) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(116) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(118) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(119) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(121) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(123) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(124) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(126) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(127) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(133) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(135) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(135) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(136) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(136) : error C2872: 'streambuf' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(143) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(143) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(144) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(144) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(145) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(145) : error C2872: 'ostream' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(147) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(147) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(148) : error C2872: 'ios' : ambiguous symbol
    c:\program files\microsoft visual studio\vc98\include\ostream.h(148) : fatal error C1003: error count exceeds 100; stopping compilation
    Error executing cl.exe.

    Transit_Observer.exe - 102 error(s), 0 warning(s)

    Danke!



  • nicht:
    #include <fstream.h>

    sondern:
    #include <fstream>
    #include <iostream>



  • Danke..



  • Und wenn der String nicht funktioniert:
    #include <string>



  • Der Code stimmt sowieso nicht, da du eben auch den Namensraum (std) nicht auflöst...



  • Kóyaánasqatsi schrieb:

    Der Code stimmt sowieso nicht, da du eben auch den Namensraum (std) nicht auflöst...

    Doch Doch der code funktionert. Ich habe hier nur ein Teil meines Codes gepostet. Hat noch viele dinge drin, die nichts mit dem Fehler zu tun hatten.



  • Was nicht stimmt, ist der Compiler - das "vc98" in den Pfaden der Fehlermeldung bedeutet, dass er Visual C++ 6 benutzt, welches vor der Standardisierung C++s geschrieben wurde und dementsprechend weit von Standardkonformität entfernt ist.

    TTS: Ich an deiner Stelle würde mir schleunigst einen neueren Compiler zulegen. Wenn du mit MSVC6 weitermachst, wirst du alle Nase lang wieder in merkwürdige Probleme laufen, und das durchaus auch mit völlig korrektem Code.



  • Sehr gerne würde ich auf visual studios 2010 umstellen. Leider ist, die Firma, bei der ich die Ausbildung als Informatiker mache noch nicht so fortgeschritten 😃


Log in to reply