This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g77 + gcc + flex + bison woes


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]