delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/14/10:07:57

X-Recipient: archive-cygwin AT delorie DOT com
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
Message-ID: <COL119-W475D6F8D846B5BCEC87BC6B0E40@phx.gbl>
From: Gery Herbozo Jimenez <gamejihou AT hotmail DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: C++ script doesn't work using g++
Date: Mon, 14 Sep 2009 13:59:08 +0000
In-Reply-To: <4AAAABA2.2050808@cygwin.com>
References: <COL119-W278EB53D1BA885C2DC5810B0E70 AT phx DOT gbl> <4AAAABA2 DOT 2050808 AT cygwin DOT com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com


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 AT cygwin DOT com
> To: gamejihou AT hotmail DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019