Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED]What am I missing for ncurses development?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

[SOLVED]What am I missing for ncurses development?

#1 Post by BowCatShot »

Debian wheezy 64 bit kde.

I'm trying to get this simple program working:

Code: Select all

#include <ncurses.h>

int main()
{	
	initscr();			/* Start curses mode 		  */
	printw("Hello World !!!");	/* Print Hello World		  */
	refresh();			/* Print it on to the real screen */
	getch();			/* Wait for user input */
	endwin();			/* End curses mode		  */

	return 0;
}
I have this installed:

libncurses5:amd64 install
libncurses5-dev install
libncursesw5:amd64 install
ncurses-base install
ncurses-bin install
ncurses-doc install
ncurses-term install

I compile like this:
gcc firstone.c -Wall -o firstone

And I get these errors:

/tmp/ccTeZP63.o: In function `main':
firstone.c:(.text+0x5): undefined reference to `initscr'
firstone.c:(.text+0x14): undefined reference to `printw'
firstone.c:(.text+0x1b): undefined reference to `stdscr'
firstone.c:(.text+0x23): undefined reference to `wrefresh'
firstone.c:(.text+0x2a): undefined reference to `stdscr'
firstone.c:(.text+0x32): undefined reference to `wgetch'
firstone.c:(.text+0x37): undefined reference to `endwin'
collect2: error: ld returned 1 exit status

What am I missing?
Last edited by BowCatShot on 2015-02-09 12:21, edited 1 time in total.

craig_mc
Posts: 2
Joined: 2010-05-02 18:58
Location: UK

Re: What am I missing for ncurses development?

#2 Post by craig_mc »

gcc firstone.c -Wall -o firstone -lncurses

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

Re: What am I missing for ncurses development?

#3 Post by BowCatShot »

Holy cow, craig_mc. I think I tried everything but that. Your suggestion worked. Thank you.

Post Reply