Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-14-2004, 07:05 PM   #1
LQ Newbie
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
Problem compiling programs using ncurses library (gcc 3.2.2 and RH9 default inst.)

I'm pretty new to linux, and was trying to get into the programming side of it. Unfortunately, however, after downloading some source code and attempting to compile it, the program errored out complaining of a few things:

undefined reference to "stdscr"
undefined reference to "mvprintw"
undefined reference to "refresh"

There are more errors than those three, but I'd rather keep this short, so I've omitted them to save time. It's almost like the ncurses library isn't there. I made sure that #include<ncurses.h> was in the file I'm attempting to compile, and also that all the functions in my program were referenced in "ncurses.h".

Sample call : mvprintw(0,0,"%s","Hello, World!")

Any help would be greatly appreciated. Thank you!
Old 07-20-2004, 01:59 PM   #2
Senior Member
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,508

Rep: Reputation: 100Reputation: 100

Are you linking in the curses library? You need a compiler command line that looks something like this:

gcc -o test test.c -lcurses

(I think!)

For example, to use the SDL library I need to compile with

gcc -o test test.c -lSDL

while "libSDL.a" is located in /usr/local/lib - the "lib" is omitted when calling GCC to compile a program.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use ncurses library skie_knite007 Programming 1 03-01-2005 10:51 AM
gnome-terminal problem while trying to use ncurses library dreamhunter Linux - Newbie 2 09-29-2004 04:22 PM
gnome-terminal problem while trying to use ncurses library dreamhunter Programming 0 09-29-2004 04:48 AM
Have anyone experimented problems compiling programs in rh9? mkaman Red Hat 2 10-31-2003 10:41 AM
apache default inst.. Robin01 Linux - Newbie 6 09-24-2003 01:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration