delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/21/21:53:56

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 21 Feb 2001 21:58:28 -0500
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
To: David Peterson <David DOT Peterson AT mail DOT idrive DOT com>
Cc: cygwin AT cygwin DOT com
Subject: Re: python 2.0, cygwin & readline - undefined symbols
Message-ID: <20010221215828.A243@dothill.com>
Mail-Followup-To: David Peterson <David DOT Peterson AT mail DOT idrive DOT com>,
cygwin AT cygwin DOT com
References: <B1F282D5B226D411B8B900E08110486F01E856E4 AT sweetness DOT idrive DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <B1F282D5B226D411B8B900E08110486F01E856E4@sweetness.idrive.com>; from David.Peterson@mail.idrive.com on Wed, Feb 21, 2001 at 05:45:06PM -0800
Organization: Dot Hill Systems Corp.

Dave,

On Wed, Feb 21, 2001 at 05:45:06PM -0800, David Peterson wrote:
> I'm trying to get python 2.0 to compile under the latest cygwin/readline
> combo, but am getting unexplainable (to me at least) linker errors.

My suggestion is to use 2.1a2 as it supports Cygwin *much* better than
previous versions.  See the following for details:

    http://www.cygwin.com/ml/cygwin-apps/2001-02/msg00004.html

Note that a patch has been accepted into Python CVS that solves the
problem below.  However, if you really need to use 2.0, then read on...

> I uncommented the line in python's Modules/Setup file to add the readline
> module and get the following when trying to build:
> 
> gcc   python.o \
>           ../libpython2.0.a -lreadline -ltermcap
> -lm  -o python.exe 
> ../libpython2.0.a(readline.o)(.text+0x949): undefined reference to
> `rl_event_hook'
> Any idea what's up?

The above is due to the "incorrect" declaration of rl_event_hook in
Modules/readline.c:

    extern Function *rl_event_hook;

I used quotes above, because the declaration is fine if you use a
static version of the readline library.  The readline provided with
Cygwin defaults to using the DLL version unless you supply a special
"-D" option during your build.

You can solve your problem with the following change:

    extern DL_IMPORT(Function) *rl_event_hook;

Although, the better way to fix this and the way that it is in the current
Python CVS, is to use include readline/history.h as in the following:

#ifdef __CYGWIN__
#include <readline/history.h>
#else /* !__CYGWIN__ */
extern int rl_parse_and_bind(char *);
extern int rl_read_init_file(char *);
extern int rl_insert_text(char *);
extern int rl_bind_key(int, Function *);
extern int rl_bind_key_in_map(int, Function *, Keymap);
extern int rl_initialize(void);
extern int add_history(char *);
extern int read_history(char *);
extern int write_history(char *);
extern int history_truncate_file(char *, int);
extern Function *rl_event_hook;
#endif /* !__CYGWIN__ */
#endif

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019