delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/14/10:48:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 14 Apr 2003 10:46:10 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Andrey Romanenko <andrew AT eq DOT uc DOT pt>
cc: cygwin AT cygwin DOT com
Subject: Re: g77 + gcc + flex + bison woes
In-Reply-To: <Pine.LNX.4.44.0304141356160.15736-100000@nectar.eq.uc.pt>
Message-ID: <Pine.GSO.4.44.0304141043340.26381-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Mon, 14 Apr 2003, Andrey Romanenko wrote:

> Dear Ronald,
>
> Thank you for your reply. This weekend I gave it another try and
> found a solution ^H^H^H^H^H^H^H^H workaround. As I suspected flex
> was at fault. The offending code is in libfl.a that contains libmain.o,
> that, in turn, has a main(). Unlike what happens under Linux, the
> linker replaced my (correct) main with the one from libfl.a no matter
> what. And, no, I didn't have YY_MAIN macro defined. My workaroind
> consisted of purging libfl.a of libmain.o. This way the program
> runs swimmingly. I am not sure why there is such difference between
> Linux and Cygwin..
>
> Andrey

Andrey,

It sounds like your compile command was something like:

   gcc -fl yourmain.o -o myprog

Did you try putting the library after your main module, like this:

   gcc yourmain.o -fl -o myprog

?  This way, the main() from your code should have been pulled in first.
The order of gcc arguments does matter, and there is usually no need to
pull a module from the library...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


--
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/

- Raw text -


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