Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3AFB536B.627452F0@ece.gatech.edu> Date: Thu, 10 May 2001 22:50:19 -0400 From: "Charles S. Wilson" X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: John DOT Velman AT HSC DOT com CC: cygwin AT cygwin DOT com Subject: Re: ?"undefined reference to rl_event_hook" References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit John DOT Velman AT HSC DOT 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 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