From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32378 invoked by alias); 14 Sep 2009 14:07:51 -0000 Received: (qmail 32361 invoked by uid 22791); 14 Sep 2009 14:07:49 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_WEB X-Spam-Check-By: sourceware.org Received: from col0-omc1-s6.col0.hotmail.com (HELO col0-omc1-s6.col0.hotmail.com) (65.55.34.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 14:07:33 +0000 Received: from COL119-W47 ([65.55.34.9]) by col0-omc1-s6.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Sep 2009 06:59:08 -0700 Message-ID: From: Gery Herbozo Jimenez To: Subject: RE: C++ script doesn't work using g++ Date: Mon, 14 Sep 2009 14:07:00 -0000 In-Reply-To: <4AAAABA2.2050808@cygwin.com> References: <4AAAABA2.2050808@cygwin.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2009-09/txt/msg00296.txt.bz2 Thanks for your answer Larry. I'll try in the same way you did. It's a pity= cygwin doesn't support borland c++. =20 Cheers, =20 Gery ---------------------------------------- > Date: Fri, 11 Sep 2009 15:57:22 -0400 > From: reply-to-list-only-lh@cygwin.com > To: gamejihou@hotmail.com > Subject: Re: C++ script doesn't work using g++ > > On 09/11/2009 02:49 PM, Gery Herbozo Jimenez wrote >> I have a simple script: >> >> #include >> #include >> int main() >> { >> clrscr(); >> cout<<"Hallo"; >> getch(); >> } >> >> However it doesn't work under this command: >> >> g++ hallo.cpp -o hallo.exe >> >> It gives: >> >> In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/back= ward/iostream.h:31, >> from hallo.cpp:1: >> /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.= h:32:2: warning: #warning This file includes at least one deprecated or ant= iquated header. Please >> consider using one of the 32 headers found in section 17.4.1.2 of the C+= + standard. Examples include substituting the header for the header for C++= includes, or >> instead of the deprecated header . To disable this warning use -Wno-depr= ecated. >> hallo.cpp:2:19: conio.h: No such file or directory >> hallo.cpp: In function `int main()': >> hallo.cpp:6: error: `clrscr' undeclared (first use this function) >> hallo.cpp:6: error: (Each undeclared identifier is reported only once fo= r each function it appears in.) >> hallo.cpp:8: error: `getch' undeclared (first use this function) >> >> Someone knows why? I tested it under borland c++ (v.5) in windows and >> works perfectly. > > That's because it's written to use Borland C++-specific facilities (i.e. > it's not > portable). Although there are a number of ways to address this, here's wh= at > I did: > > #include=20 > #include=20 > > using namespace std; > > int main() > { > initscr(); > clear(); > refresh(); > > cout<<"Hallo"; > cout<> getch(); > endwin(); > } > > g++ hallo.cpp -o hallo.exe -lcurses > > Of course, to make this work you'll need to install the ncurses-devel pac= kage. > > -- > Larry Hall http://www.rfk.com > RFK Partners, Inc. (508) 893-9779 - RFK Office > 216 Dalton Rd. (508) 893-9889 - FAX > Holliston, MA 01746 > > _____________________________________________________________________ > > A: Yes. >> Q: Are you sure? >>> A: Because it reverses the logical flow of conversation. >>>> Q: Why is top posting annoying in email? _________________________________________________________________ Hay tantos ordenadores como personas. =A1Descubre ahora cu=E1l eres t=FA! http://www.quepceres.com/ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple