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: <3A37B4FA.984D9F57@ece.gatech.edu> Date: Wed, 13 Dec 2000 12:42:18 -0500 From: Charles Wilson X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: John Wiersba CC: cygwin AT sources DOT redhat DOT com Subject: Re: curses problem trying to build ruby References: <03F4742D8225D21191EF00805FE62B9904B3F681 AT aa-msg-01 DOT medstat DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit John Wiersba wrote: > > Charles, > > I simplified the problem a little, to get rid of dllwrap: > > $ cd ruby-1.6.1/ext/curses > $ gcc curses.o -L../.. -lcygwin-ruby16 -lncurses > curses.o: In function `free_window': > /.../ruby-1.6.1/ext/curses/curses.c:65: undefined reference to `stdscr' > ... > > It looks like stdscr is not defined in libncurses. But, > > $ cd /usr/lib > $ ls -l *cur* > lrw-r--r-- 1 jrw JRW 23 Dec 12 18:36 libcurses.a -> libncurses.a > lrw-r--r-- 1 jrw JRW 27 Dec 12 18:36 libcurses.dll.a -> > libncurses.dll.a > -rw-r--r-- 1 jrw JRW 277240 Nov 25 00:44 libncurses++.a > -rw-r--r-- 1 jrw JRW 392186 Nov 25 00:08 libncurses.a > -rw-r--r-- 1 jrw JRW 263752 Nov 25 00:44 libncurses.dll.a > -rw-r--r-- 1 jrw JRW 4820 Nov 11 01:32 libsecur32.a > $ nm libncurses.a | grep stdscr > U _stdscr > ... > U _stdscr > 00000000 D _stdscr > U _stdscr > > seems to show that it is. But you're not linking to libncurses.a. You are linking to libncurses.dll.a, the dll import lib. To avoid this, you have to specify -static. But that's not the real puzzler. /usr/include/ncurses.h defines stdscr thus: extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; which expands to extern __declspec(dllimport) WINDOW * stdscr; Short version: curses.o should have the following undefined symbol U _imp__stdscr not U _stdscr And by linking to libncurses.dll.a (the default), the linker will find __imp__stdscr. However, it appears that you are including a *different* ncurses.h from somewhere, because your curses.o is not seeing the __declspec(dllimport) decoration. Do you have an old ncurses installed in '/usr/local' ? If so (and if it's the old cygutils version) remove it using http://cygutils.netpedia.net/V1.1/usr-local/Obsolete.html -- but READ the directions first: you only want to remove /usr/local/---ncurses, not /usr/local/---everything. (If you have other programs that have been compile using the /usr/local/---ncurses, you'll need to set TERMINFO=/usr/share/terminfo to prevent them from looking in /usr/local/share/terminfo for their terminfo database). --Chuck -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com