Thanks Kai, it works.
It differs from the NIX-systems in the -l (hyphen ell) option.

From: Kai Tietz <>
To: MinGW Users List <>
Sent: Thursday, May 14, 2009 7:28:31 PM
Subject: Re: [Mingw-users] GCC with Flex Link Library

2009/5/14 Yara Fredmann <>:
> Dear all,
> I've searched the list of questions but couldn't find an answer to my
> question. In addition the SF search engine provides results for all the
> products and not for answers in their mailing lists. Please accept my
> apologies if my question was repeated.
> I'm using the Flex, Fast lexical analyzer generator.
> However, to compile the resulting file, lex.yy.c, I could not figure it out
> of what the exact link library to include in the gcc command line options,
> or whether I have to set up my PATH environment library before. Therefore, I
> copied the file libfl.a into the current working directory where the
> lex.yy.c is located, and I issued the command
> d:\workspace\htiny\scand\lexscan>gcc lex.yy.c -llibfl
> C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot
> find -llibfl
> collect2: ld returned 1 exit status
> or  -llibfl.a
> Where I copied libfl.a into the same directory where the program lex.yy.c is
> located.
> Any input is much appreciated. Thank you.
> Yacov


copy the lib into mingw/lib, or use command line
'd:\workspace\htiny\scand\lexscan>gcc lex.yy.c libf.a'


|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled.
MinGW-users mailing list

This list observes the Etiquette found at
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
You may change your MinGW Account Options or unsubscribe at: