Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <435ED82E.6060602@ateb.com>
Date: Tue, 25 Oct 2005 21:13:18 -0400
From: Reid Thompson <Reid.Thompson@ateb.com>
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
MIME-Version: 1.0
To: Jeff Scudder <jeffrey.scudder@gmail.com>
Cc: cygwin@cygwin.com
Subject: Re: undefined references compiling gcc with ncurses
References: <d75352a00510251638n27cc0de1k2313b470588547a9@mail.gmail.com>
In-Reply-To: <d75352a00510251638n27cc0de1k2313b470588547a9@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Jeff Scudder wrote:

>Greetings,
>I am a curses newbie and having trouble running a simple curses
>program. I haven't run into a discussion thus far on the specific
>problem I'm having and I imagine there is a simple solution. My
>program is named ctest.c and is as follows:
>
>
>#include<stdio.h>
>#include<curses.h>
>
>int main()
>{
>  initsscr();
>  cbreak();
>  noecho();
>  char x = getch();
>  while(x != 'q')
>  {
>    printf("Entered: %c\n",x);
>    x = getch();
>  }
>  endwin();
>}
>
>And I compile using
>
>gcc -lncurses ctest.c
>
>When linking I get an undefined reference for each curses function.
>I'm sure I'm doing something wrong.
>
>Thank you,
>
>JS
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Problem reports:       http://cygwin.com/problems.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/fa
>  
>

#include <ncurses.h>

or

#include <ncurses/ncurses.h>


do a
find /usr/include -name ncurses.h  --  i'm not on a cygwin box right now..

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

