This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ?"undefined reference to rl_event_hook"




John.Velman@HSC.com wrote:
> 
> I'm out of my depth here --
> 
> I'm trying to compile swiprolog.   Everything seems
> to compile, but at the link stage the following results:
> 
> ----
> gcc  -o pl -Lrc pl-atom.o pl-wam.o pl-stream.o pl-error.o pl-arith.o pl-bag.o pl
> -comp.o pl-rc.o pl-dwim.o pl-ext.o pl-file.o pl-flag.o pl-fmt.o pl-funct.o pl-gc
> .o pl-glob.o pl-itf.o pl-list.o pl-load.o pl-modul.o pl-op.o pl-os.o pl-prims.o
> pl-pro.o pl-proc.o pl-prof.o pl-read.o pl-rec.o pl-rl.o pl-setup.o pl-sys.o pl-t
> able.o pl-trace.o pl-util.o pl-wic.o pl-write.o pl-term.o pl-buffer.o pl-thread.
> o pl-xterm.o pl-feature.o pl-ctype.o pl-main.o pl-extend.o frame.o -lrc -lreadli
> ne -lncurses -lm
> pl-rl.o(.text+0x1c1):pl-rl.c: undefined reference to `rl_event_hook'
> pl-rl.o(.text+0x1ce):pl-rl.c: undefined reference to `rl_event_hook'
> collect2: ld returned 1 exit status
> make: *** [pl] Error 1
> 
> ----
> 
> I checked, and libreadline.a is in /usr/lib, and of course a run
> of nm -s libreadline.a shows entries for _rl_event_hook.

You are not linking against libreadline.a.  You are linking against
libreadline.dll.a, which defines "__imp_rl_event_hook".  To force a link
against libreadline.a, use the "-static" flag in your gcc command line. 
(But be prepared for other errors, because something is obviously wrong
in your build process; see next paragraph).

However, the fact that your object files are looking for rl_event_hook
means that the symbol was defined incorrectly.  Does swiprolog include
its own definition for rl_event_hook?  (It shouldn't: it should #include
<readline.h> and then all would be well).

Take a look at /usr/doc/Cygwin/readline-4.1.README.

--Chuck

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]