Subject: [clisp-list] clisp-link & -lfl

From: Nicolas Dittlo <[email-masked]>
Date: Wed, 2 Aug 2000 13:53:30 +0200

Hello,
I have a problem when I try to build a module with a C file generated by
flex. It seems there are two symbols 'main' in conflict; one in
lisp.a, and the other in the library required to compile
flex-generated code.
Do somebody know a solution?
<nl><nl>

Here is the session:
<nl><nl>

clisp-link add-module-set /root/lib/gl-bindings-module/ 
base /root/lib/base+gl
make: Nothing to be done for `clisp-module'.
gcc -O -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-f
rame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAM
IC_FFI -I/usr/local/clisp-2000-03-06/src -c modules.c
In file included from modules.d:11:
/usr/local/clisp-2000-03-06/src/clisp.h:426: warning: register used for two gl
obal register variables
gcc -O -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-f
rame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAM
IC_FFI -x none modules.o gl-bindings.o glu-bindings.o c_utils.o c_utils_base.o
<nl> image.o -L/usr/X11R6/lib -lXm -lXt -lXext -lX11 -lXmu -lXi -lm -lGLU -lGL -lf
l lisp.a libsigsegv.a libiconv.a libintl.a libreadline.a libavcall.a libcallba
ck.a -ltermcap -ldl -o lisp.run
lisp.a(lisp.o): In function `main':
lisp.o(.text+0x789c): multiple definition of `main'
/usr/lib/libfl.a(libmain.o)(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 18 to 4503 in lisp.o
/usr/lib/libfl.a(libmain.o): In function `main':
libmain.o(.text+0x4): undefined reference to `yylex'
collect2: ld returned 1 exit status
/root/lib/base+gl/lisp.run -M base/lispinit.mem -q -i /root/lib/gl-bindings-mo
dule//gl-bindings.fas /root/lib/gl-bindings-module//glu-bindings.fas /root/lib
/gl-bindings-module//c_utils.fas -x (saveinitmem "/root/lib/base+gl/lispinit.m
em")
./clisp-link: /root/lib/base+gl/lisp.run: Aucun fichier ou répertoire de ce ty
pe
<nl><nl>

Thank you.
Niko.
(2 is better than 0)

---

From: Bruno Haible <[email-masked]>
Date: Wed, 2 Aug 2000 15:26:06 +0200 (CEST)

> lisp.a, and the other in the library required to compile

You don't really need libfl. "nm /usr/lib/libfl.a" shows you that it
defines just two symbols: 'main' (which you don't need since clisp has
its own main function) and 'yywrap' (which you don't need if you use
"%option noyywrap" in your grammar file).

Bruno