delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/26/01:51:08

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <435F193E.1000807@familiehaase.de>
Date: Wed, 26 Oct 2005 07:50:54 +0200
From: "Gerrit P. Haase" <gerrit AT familiehaase DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915
MIME-Version: 1.0
To: Jeff Scudder <jeffrey DOT scudder AT gmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: undefined references compiling gcc with ncurses
References: <d75352a00510251638n27cc0de1k2313b470588547a9 AT mail DOT gmail DOT com>
In-Reply-To: <d75352a00510251638n27cc0de1k2313b470588547a9@mail.gmail.com>
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.

Try:
gcc ctest.c -lncurses


Gerrit
-- 
=^..^=

--
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/

- Raw text -


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