delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/25/21:58:18

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
To: cygwin AT cygwin DOT com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <rberber AT prodigy DOT net DOT mx>
Subject: Re: undefined references compiling gcc with ncurses
Date: Tue, 25 Oct 2005 20:54:26 -0500
Lines: 39
Message-ID: <djmnki$76t$1@sea.gmane.org>
References: <d75352a00510251638n27cc0de1k2313b470588547a9 AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
In-Reply-To: <d75352a00510251638n27cc0de1k2313b470588547a9@mail.gmail.com>
OpenPGP: url=ldap://keyserver.pgp.com
X-IsSubscribed: yes

Jeff Scudder wrote:

> 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:
>=20
>=20
> #include<stdio.h>
> #include<curses.h>
>=20
> int main()
> {
>   initsscr();
--------^
    initscr
>   cbreak();
>   noecho();
>   char x =3D getch();
>   while(x !=3D 'q')
>   {
>     printf("Entered: %c\n",x);
>     x =3D getch();
>   }
>   endwin();
> }
>=20
> And I compile using
>=20
> gcc -lncurses ctest.c

Try: gcc -o test ctest.c -lncurses

> When linking I get an undefined reference for each curses function.
> I'm sure I'm doing something wrong.

The program doesn't do anything until 'q' is typed...
--=20
Ren=E9 Berber


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