Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3D57EC78.9060206@unu.edu> Date: Tue, 13 Aug 2002 02:12:24 +0900 From: =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?= Organization: UNU Campus Computing Centre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1b) Gecko/20020801 X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: GCC3 problems with C++ fstream References: <187198960129 DOT 20020812184802 AT familiehaase DOT de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Check: by UNU Campus Computing Centre (HQmail) Gerrit P. Haase wrote: > #include > void main() //the program starts here main() must return 'int' > { > ofstream SaveFile("cygwin.txt"); ofstream lives in the 'std' namespace > SaveFile << "Hello World, this works with gcc-2 but not with gcc-3!"; > SaveFile.close(); > } Try this corrected version: #include int main() { using namespace std; ofstream saveFile("test.txt"); saveFile << "Hello World, this works with gcc-2 but not with gcc-3!"; saveFile.close(); return 0; } Hope this helps, -- Ney André de Mello Zunino Media and Technology Laboratory Campus Computing Centre United Nations University -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/