help needed: linking wish and libfl with egcs or gcc under gnu-win32 fails
Joachim Faulhaber
jofa@berlin.snafu.de
Fri Aug 14 01:39:00 GMT 1998
Hello,
I'm (still 8-|) working on the portation of a c++-program from Linux
to win32
whereby I use tk80 for the unserinterface and gnu-win32 b19.1 as
development
kit.
I'm unable to link my sources including a standard winMain.o from
the
latest tk distribution. I sent a post about the problem to
gnu-win32@cygnus.com and comp.lang.tcl last sunday, but I didn't
get any
answers.
Since this portation is quite important to me and due to the fact
that this
task seems to be a standard case for many other projects I'm posting
this
topic again.
I'd be happy if anyone can give me any feedback about the problem.
I'd be even more happy if someone can give me clues what I can
do about it.
Since my last posting, I upgraded the compiler from gcc to egcs-1.0.2,
including binutils-980303 and lib++-2.8.0, as recommended by Mumit
Khan. But
the behavior is just the same as with gcc.
So I did a few "shooting in the dark"-experiments and tried to reduce
the
problem to it's essence which is:
--> A standard wish cannot be linked successfully with libfl under
gnu-win32:
ÃÂ
objects to be linkedÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
result
-----------------------------------------------------------------------
winMain.o + tkConsole.oÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
=>ÃÂ a running wish, ok
winMain.o + tkConsole.o + libfl.aÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
=>ÃÂ error:unresolved ref to yylex
winMain.o + tkConsole.o + libfl.a + lexer.o =>ÃÂ not launching
wish
where lexer.c is a mini lexer-progam, generated by flex
I *very* much apprechiate any feedback or clue
Thanx in advance
- Joachim
ÃÂ
-------- more details follow: ---------------------
Results were obtained using this makefile:
winMain.c and tkConsole.c are from tk8.0p2 sources
lexer.l is a little dummy-lexer wich is not called.
----------------------------- makefile -----------------------------
tkConsole.o: tkConsole.c
ÃÂ gcc -c -I. tkConsole.c -o tkConsole.o
winMain.o: winMain.c
ÃÂ gcc -c winMain.c -o winMain.o
lexer.o: lexer.c
ÃÂ gcc -c lexer.c -o lexer.o
lexer: lexer.l
ÃÂ flex -t lexer.l > lexer.c
myWish: winMain.o tkConsole.o
ÃÂ gcc winMain.o tkConsole.o -o myWish \
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
-mwindows -ltk80 -ltcl80
myWish1: winMain.o tkConsole.o
ÃÂ gcc winMain.o tkConsole.o -o myWish1 \
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
-mwindows -ltk80 -ltcl80 -lfl
myWish2: winMain.o tkConsole.o lexer.o
ÃÂ gcc winMain.o tkConsole.o lexer.o -o myWish2 \
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
-mwindows -ltk80 -ltcl80 -lfl
--------------------------------------------------------------------
make myWish:
ÃÂ ÃÂ produces a remarkable number of warnings, but yields
a running wish
ÃÂ
gcc -c winMain.c -o winMain.o
In file included from C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\egcs-2.9
0.27\../../../../i386-cygwin32/include/windows.h:52,
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
from winMain.c:16:
C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\egcs-2.90.27\../../../../i386-
cygwin32/include/Windows32/Structures.h:2434: warning: empty declaration
C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\egcs-2.90.27\../../../../i386-
cygwin32/include/Windows32/Structures.h:2480: warning: empty declaration
C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\egcs-2.90.27\../../../../i386-
cygwin32/include/Windows32/Structures.h:3411: warning: empty declaration
gcc -c -I. tkConsole.c -o tkConsole.o
In file included from tkPort.h:27,
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
from tkInt.h:26,
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
from tkConsole.c:16:
tkWinPort.h:119: warning: `struct timeval' declared inside parameter
list
tkWinPort.h:119: warning: its scope is only this definition or
declaration,
tkWinPort.h:119: warning: which is probably not what you want.
gcc winMain.o tkConsole.o -o myWish \
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
-mwindows -ltk80 -ltcl80
/CYGNUS/B19/H-I386~1/i386-cygwin32/bin/ld.exe: warning: cannot
find entry symbo
l _WinMainCRTStartup; defaulting to 00401000
----------------------------------------------------------------------
make myWish1:
ÃÂ ÃÂ produces the same warnings as myWish and the additional
error:
C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\egcs-2.90.27\../../../libfl.a
(libmain.o)(.text+0x9):libmain.c: undefined reference to `yylex'
make: *** [myWish1] Error 1
----------------------------------------------------------------------
make myWish2:
ÃÂ ÃÂ warnings like myWish, but the linked program terminates
immediately
ÃÂ ÃÂ whithout launching wish
ÃÂ
More information about the Cygwin
mailing list