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: <5.1.0.14.2.20020730195838.02bec170@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Tue, 30 Jul 2002 20:00:16 -0700 To: =?BIG5?B?sWmr7a3X?= , cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: "parse error before" bug In-Reply-To: <20020731104833.C5C6.CHANGHT@ismp.iie.ncku.edu.tw> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Hi, You named the source file "go.c" and invoked the compiler with "gcc," so your source code is being interpreted as C, not C++. In C, all declarations must precede all executable lines within any given block. Randall Schulz Mountain View, CA USA At 19:49 2002-07-30, =?BIG5?B?sWmr7a3X?= wrote: >hi > >i'm compiling a small program go.c like: > >---------------------------------------------- >#include >int main(){ > printf("parse error after this"); > int a; >} >---------------------------------------------- > >with the error below: > >---------------------------------------------- >$ gcc go.c -o go >go.c: In function `main': >go.c:4: parse error before `int' > >---------------------------------------------- > >i found removing the line "printf(....);" turns to be OK then. -- 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/