public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GNU's bc with readline library?
@ 2001-01-02  6:31 Josifovski Ljubomir-BLJ01Z
  2001-01-02 21:25 ` Charles Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Josifovski Ljubomir-BLJ01Z @ 2001-01-02  6:31 UTC (permalink / raw)
  To: Cygwin Mailing List (E-mail)

While trying to compile GNU's bc with the readline library:

sysop@ZUK02-0544 ~/bc-1.06
$ ./configure --with-readline
loading cache ./config.cache
... (snip)
checking for readline in -lreadline... (cached) yes
checking for readline/readline.h... (cached) yes
Using the readline library.
... (snip)
creating config.h

I get:

sysop@ZUK02-0544 ~/bc-1.06
$ make
... (snip)
Making all in bc
make[2]: Entering directory `/home/sysop/bc-1.06/bc'
... (snip)
gcc  -g -O2 -Wall -funsigned-char  -o bc  main.o bc.o scan.o execute.o
load.o st
orage.o util.o global.o ../lib/libbc.a -lfl -lreadline -lncurses
scan.o(.text+0x155b): undefined reference to `rl_instream'
collect2: ld returned 1 exit status
make[2]: *** [bc] Error 1
make[2]: Leaving directory `/home/sysop/bc-1.06/bc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sysop/bc-1.06'
make: *** [all-recursive-am] Error 2

I see:

$ objdump --syms bc/scan.o | grep rl_instream
[ 60](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _rl_instream

and that rl_instream is defined:

$ nm --print-file-name /usr/lib/libreadline.a | grep 'rl_instream'
/usr/lib/libreadline.a:readline.o:00000024 D _rl_instream
... (snip)

Any hints?

Without readline it compiles and links fine.

thanks,

-- 
Ljubomir Josifovski
mailto:L.Josifovski@dcs.shef.ac.uk,blj01z@email.mot.com
http://www.dcs.shef.ac.uk/~ljupco


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GNU's bc with readline library?
  2001-01-02  6:31 GNU's bc with readline library? Josifovski Ljubomir-BLJ01Z
@ 2001-01-02 21:25 ` Charles Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Wilson @ 2001-01-02 21:25 UTC (permalink / raw)
  To: Josifovski Ljubomir-BLJ01Z; +Cc: Cygwin Mailing List (E-mail)

scan.o *should* be looking for __imp__rl_instream, not rl_instream.  The
problem seems to be that scan.c doesn't see the declaration of
rl_instream as it appears in the *cygwin*
/usr/include/readline/readline.h:

extern READLINE_EXPORT_VAR(FILE *) rl_instream;

which expands to:

extern __declspec(dllimport) FILE * rl_instream;

Does scan.c declare rl_instream itself as "extern FILE * rl_instream",
instead of including readline.h ?

--Chuck


Josifovski Ljubomir-BLJ01Z wrote:
> 
> While trying to compile GNU's bc with the readline library:
> 
> sysop@ZUK02-0544 ~/bc-1.06
> $ ./configure --with-readline
> loading cache ./config.cache
> ... (snip)
> checking for readline in -lreadline... (cached) yes
> checking for readline/readline.h... (cached) yes
> Using the readline library.
> ... (snip)
> creating config.h
> 
> I get:
> 
> sysop@ZUK02-0544 ~/bc-1.06
> $ make
> ... (snip)
> Making all in bc
> make[2]: Entering directory `/home/sysop/bc-1.06/bc'
> ... (snip)
> gcc  -g -O2 -Wall -funsigned-char  -o bc  main.o bc.o scan.o execute.o
> load.o st
> orage.o util.o global.o ../lib/libbc.a -lfl -lreadline -lncurses
> scan.o(.text+0x155b): undefined reference to `rl_instream'
> collect2: ld returned 1 exit status
> make[2]: *** [bc] Error 1
> make[2]: Leaving directory `/home/sysop/bc-1.06/bc'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/sysop/bc-1.06'
> make: *** [all-recursive-am] Error 2
> 
> I see:
> 
> $ objdump --syms bc/scan.o | grep rl_instream
> [ 60](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _rl_instream
> 
> and that rl_instream is defined:
> 
> $ nm --print-file-name /usr/lib/libreadline.a | grep 'rl_instream'
> /usr/lib/libreadline.a:readline.o:00000024 D _rl_instream
> ... (snip)
> 
> Any hints?
> 
> Without readline it compiles and links fine.
> 
> thanks,
> 
> --
> Ljubomir Josifovski
> mailto:L.Josifovski@dcs.shef.ac.uk,blj01z@email.mot.com
> http://www.dcs.shef.ac.uk/~ljupco
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: GNU's bc with readline library?
@ 2001-01-03  1:16 Josifovski Ljubomir-BLJ01Z
  0 siblings, 0 replies; 3+ messages in thread
From: Josifovski Ljubomir-BLJ01Z @ 2001-01-03  1:16 UTC (permalink / raw)
  To: 'Charles Wilson', Cygwin Mailing List (E-mail)

Right on the spot - yes, scan.l doesn't include readline.h but declares
rl_instream itself. Sorted.

Thanks!
Ljubomir

> -----Original Message-----
> From: Charles Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: 03 January 2001 05:29
> To: Josifovski Ljubomir-BLJ01Z
> Cc: Cygwin Mailing List (E-mail)
> Subject: Re: GNU's bc with readline library?
> 
> 
> scan.o *should* be looking for __imp__rl_instream, not 
> rl_instream.  The
> problem seems to be that scan.c doesn't see the declaration of
> rl_instream as it appears in the *cygwin*
> /usr/include/readline/readline.h:
> 
> extern READLINE_EXPORT_VAR(FILE *) rl_instream;
> 
> which expands to:
> 
> extern __declspec(dllimport) FILE * rl_instream;
> 
> Does scan.c declare rl_instream itself as "extern FILE * rl_instream",
> instead of including readline.h ?
> 
> --Chuck
> 
> 
> Josifovski Ljubomir-BLJ01Z wrote:
> > 
> > While trying to compile GNU's bc with the readline library:
> > 
> > sysop@ZUK02-0544 ~/bc-1.06
> > $ ./configure --with-readline
> > loading cache ./config.cache
> > ... (snip)
> > checking for readline in -lreadline... (cached) yes
> > checking for readline/readline.h... (cached) yes
> > Using the readline library.
> > ... (snip)
> > creating config.h
> > 
> > I get:
> > 
> > sysop@ZUK02-0544 ~/bc-1.06
> > $ make
> > ... (snip)
> > Making all in bc
> > make[2]: Entering directory `/home/sysop/bc-1.06/bc'
> > ... (snip)
> > gcc  -g -O2 -Wall -funsigned-char  -o bc  main.o bc.o 
> scan.o execute.o
> > load.o st
> > orage.o util.o global.o ../lib/libbc.a -lfl -lreadline -lncurses
> > scan.o(.text+0x155b): undefined reference to `rl_instream'
> > collect2: ld returned 1 exit status
> > make[2]: *** [bc] Error 1
> > make[2]: Leaving directory `/home/sysop/bc-1.06/bc'
> > make[1]: *** [all-recursive] Error 1
> > make[1]: Leaving directory `/home/sysop/bc-1.06'
> > make: *** [all-recursive-am] Error 2
> > 
> > I see:
> > 
> > $ objdump --syms bc/scan.o | grep rl_instream
> > [ 60](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 
> _rl_instream
> > 
> > and that rl_instream is defined:
> > 
> > $ nm --print-file-name /usr/lib/libreadline.a | grep 'rl_instream'
> > /usr/lib/libreadline.a:readline.o:00000024 D _rl_instream
> > ... (snip)
> > 
> > Any hints?
> > 
> > Without readline it compiles and links fine.
> > 
> > thanks,
> > 
> > --
> > Ljubomir Josifovski
> > mailto:L.Josifovski@dcs.shef.ac.uk,blj01z@email.mot.com
> > http://www.dcs.shef.ac.uk/~ljupco
> > 
> > --
> > Want to unsubscribe from this list?
> > Check out: http://cygwin.com/ml/#unsubscribe-simple
> 

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-03  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-02  6:31 GNU's bc with readline library? Josifovski Ljubomir-BLJ01Z
2001-01-02 21:25 ` Charles Wilson
2001-01-03  1:16 Josifovski Ljubomir-BLJ01Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).