X-Spam-Check-By: sourceware.org Date: Fri, 15 Sep 2006 15:05:08 +0200 (MET DST) From: Angelo Graziosi To: cygwin AT cygwin DOT com Subject: Re: G77, libg2c and a linking problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 I wrote: > I would know if the following is a normal behaviour... > > > program hello > implicit none > write(*,*) 'Hello!' > end > > > $ g77 hello.F -o hello -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c > /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):(.text+0xab): > undefined reference to `_WinMain AT 16' > collect2: ld returned 1 exit status > > > ... or if it is a problem. > > I use GCC-3.4.4-2. I observe also the following: 1) adding -s at the end works $ g77 hello.F -o hello -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c -s 2) but after hello.F, doesn't $ g77 hello.F -s -o hello -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):(.text+0xab): undefined reference to `_WinMain AT 16' collect2: ld returned 1 exit status 3) moving '-o hello' at the end works $ g77 hello.F -s -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c -o hello 4) also moving -s works $ g77 hello.F -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c -s -o hello 5) or removing it $ g77 hello.F -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lg2c -o hello Cheers, Angelo. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/