From: jofa AT berlin DOT snafu DOT de (Joachim Faulhaber) Subject: Re: linking tk's winMain.o with libfl under cygnus: linker-error 25 Sep 1998 04:28:42 -0700 Message-ID: <360ABF6E.1A4198CB.cygnus.gnu-win32@berlin.snafu.de> References: <35CD9024 DOT 71108032 AT berlin DOT snafu DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: gnu-win32 AT cygnus DOT com Hello, a few weeks ago, I posted this problem. Meanwhile I found a workaround for it. > 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 > Cygnus > b19.1 on win95 and tcl/tk8.0. > > ... but I couln't get rid of the following > linker error: > > C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\ > 2.7-B19\../../../libfl.a(libmain.o)(.text+0x9):libmain.c: > undefined reference to `yylex' > make: *** [myWish] Error 1 > > I figured out, that the error is independend of my own sources, by > compiling > 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 > -mwindows > ----------------------------------------- > 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 workaround: 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 :) Regards Joachim Faulhaber - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".