linking tk's winMain.o with libfl under cygnus: linker-error
Thu Sep 24 19:59:00 GMT 1998
a few weeks ago, I posted this problem. Meanwhile I found a workaround
> I am working on porting a c++ program from linux to windoze. The user
> interface is implemented via an extension of tk's wish. I'm using
> b19.1 on win95 and tcl/tk8.0.
> ... but I couln't get rid of the following
> linker error:
> undefined reference to `yylex'
> make: *** [myWish] Error 1
> I figured out, that the error is independend of my own sources, by
> the following minimal myWish program:
> ------------- makefile: -----------------
> tkConsole.o: tkConsole.c
> gcc -c -I. tkConsole.c -o tkConsole.o
> winMain.o: winMain.c
> gcc -c winMain.c -o winMain.o
> myWish: winMain.o tkConsole.o
> gcc tkConsole.o winMain.o -o myWish -ltk80 -ltcl80 -lfl -lm
The problem seems to be the flex-lib libfl, which somehow does't work
correctly with windows. Some flexpert should look at it. But there's a
Libfl doesn't do very much. It just provides a default yywrap function,
which isn't needed in most cases.
If you don't need to scan multiple files, use the %option noyywrap. If
you need the yywrap function you can define your own. In both cases you
can link your programs without libfl, and the linker-error disappears :)
For help on using this list (especially unsubscribing), send a message to
"firstname.lastname@example.org" with one line of text: "help".
More information about the Cygwin