From: jofa AT berlin DOT snafu DOT de (Joachim Faulhaber) Subject: linking tk's winMain.o with libfl under cygnus: linker-error 9 Aug 1998 09:34:12 -0700 Message-ID: <35CD9024.71108032.cygnus.gnu-win32@berlin.snafu.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------64C8ADB7C42F2A01F329BB48" To: gnu-win32 AT cygnus DOT com --------------64C8ADB7C42F2A01F329BB48 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello again, 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. Thanks to Mumit Khan (Mumit, thank you for your posting) I got the information needed to link everything together. 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 ----------------------------------------- where winMain.c and tkConsole.c are from the latest soucecode distrib of tk8.0. This program yields a proper wish-shell on my windoze95, when linked without the -lfl flag. Adding -lfl results in the linkererror reported above. Since I'm using flex and bison in my own application, I have to use libfl, so I'm unable to link my program :( Another observation is, that the linker works normal when I am linking with the a usual main() like in tkappinit.c from unix. Also yylex() works fine then, when used. Does anybody know how to solve the problem? - am I missing something trivial ;-/ ? - would the egcs compiler have the same problem ? - are there alternative ways to build my application (via: loadable extension - as suggested by Mumit Khan - instad of extending wish) How would that work? Any help is much appreciated -- Joachim Faulhaber --------------64C8ADB7C42F2A01F329BB48 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hello again,

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.

Thanks to Mumit Khan (Mumit, thank you for your posting) I got the information
needed to link everything together. 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
-----------------------------------------

where winMain.c and tkConsole.c are from the latest soucecode distrib of
tk8.0. This program yields a proper wish-shell on my windoze95, when linked
without the -lfl flag. Adding -lfl results in the linkererror reported
above.

Since I'm using flex and bison in my own application, I have to use libfl,
so I'm unable to link my program :( Another observation is, that the linker
works normal when I am linking with the a usual main() like in tkappinit.c
from unix. Also yylex() works fine then, when used.
 

Does anybody know how to solve the problem?
- am I missing something trivial ;-/ ?
- would the egcs compiler have the same problem ?
- are there alternative ways to build my application
  (via: loadable extension - as suggested by Mumit Khan - instad of
  extending wish) How would that work?

Any help is much appreciated

-- Joachim Faulhaber --------------64C8ADB7C42F2A01F329BB48-- - 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".