From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13457 invoked by alias); 18 Feb 2013 15:37:36 -0000 Received: (qmail 13350 invoked by uid 22791); 18 Feb 2013 15:37:35 -0000 X-SWARE-Spam-Status: No, hits=2.3 required=5.0 tests=AWL,BAYES_50,DKIM_ADSP_CUSTOM_MED,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,NML_ADSP_CUSTOM_MED,URI_HEX X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 15:37:22 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1U7SmQ-0003Ds-BB for cygwin-xfree@cygwin.com; Mon, 18 Feb 2013 07:37:22 -0800 Date: Mon, 18 Feb 2013 15:37:00 -0000 From: jere95 To: cygwin-xfree@cygwin.com Message-ID: <1361201816.40559.YahooMailNeo@web171406.mail.ir2.yahoo.com> In-Reply-To: <5122464D.8060103@Winfirst.Com> References: <1361197597703-96267.post@n5.nabble.com> <1361198544.5452.0@ffortso4> <5122464D.8060103@Winfirst.Com> Subject: Re: "Erreur" messages when trying to compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2013-02/txt/msg00049.txt.bz2 Thanks a lot I was able to solve the problem! ________________________________ De=C2=A0: Mark Hansen-4 [via Cygwin] =C3=80=C2=A0: jere95 =20 Envoy=C3=A9 le : Lundi 18 f=C3=A9vrier 2013 16h19 Objet=C2=A0: Re: "Erreur" messages when trying to compile =20 On 2/18/2013 6:42 AM, Jack wrote:=20 > On 2013.02.18 09:26, jere95 wrote:=20 >> Hi,=20 >> I am new to programming and I downloaded cygwin, because I heard it =C2= =A0=20 >> was a=20 >> good gcc compiler. At the moment I am reading this O'reilly book on =C2= =A0=20 >> C, and I=20 >> tried compiling the folowing exemple programme out of the book :=20 >>=20 >> When I try to compile, this c file, typing : /gcc cards.c -o cards/ , = =C2=A0=20 >> the=20 >> cygwin terminal answers :=20 >>=20 >>=20 >>=20 >> What is the problem?=20 > For some reason, your examples are not coming through to the mailing =C2= =A0=20 > list.=20 >=20 > However, it looks like the messages are very clear. =C2=A0You seem to be = =C2=A0=20 > using "(" (left parenthesis) instead of "{" (left curly brace) on many = =C2=A0=20 > lines. =C2=A0gcc is expecting a closing parenthesis before the next =C2= =A0=20 > semicolon, and it is expecting a semicolon =C2=A0before the next closing = =C2=A0=20 > curly brace.=20 Yes, here is his example program:=20 #include=20 #include=20 int main()=20 {=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char card_name[ 3];=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 puts("Enter the card_name: ");=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 scanf("%2s", card_name);=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int val =3D 0;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (card_name[0] =3D=3D 'K') (=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D 10;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (card_name[0] =3D=3D 'Q') (=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D 10;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (card_name[0] =3D=3D 'J') (=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D 10;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }else if (card_name[0] =3D=3D 'A') (=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D 11;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }else (=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D atoi(card_n= ame);=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printf("The card value is: %i\n", val);=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }=20 Look at this line, for example:=20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (card_name[0] =3D=3D 'K') (=20 My guess is that you typed this in by hand, and didn't see clearly=20 that the last character should have been an open brace '{' rather=20 than an open parentheses '('. It looks like you've made the same=20 error in several other places.=20 --=20 Unsubscribe info: =C2=A0 =C2=A0 =C2=A0http://cygwin.com/ml/#unsubscribe-sim= ple Problem reports: =C2=A0 =C2=A0 =C2=A0 http://cygwin.com/problems.html Documentation: =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://x.cygwin.com/docs/ FAQ: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://= x.cygwin.com/docs/faq/ ________________________________ =20 If you reply to this email, your message will be added to the discussion be= low:http://cygwin.1069669.n5.nabble.com/Erreur-messages-when-trying-to-comp= ile-tp96267p96269.html=20 To unsubscribe from "Erreur" messages when trying to compile, click here. NAML -- View this message in context: http://cygwin.1069669.n5.nabble.com/Erreur-me= ssages-when-trying-to-compile-tp96267p96271.html Sent from the cygwin-xfree mailing list archive at Nabble.com. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/