LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 07-14-2004, 08:05 PM   #1
jclark7777
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, 02:59 PM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,477

Rep: Reputation: 87
Hi

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.
 
  


Reply


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 11:51 AM
gnome-terminal problem while trying to use ncurses library dreamhunter Linux - Newbie 2 09-29-2004 05:22 PM
gnome-terminal problem while trying to use ncurses library dreamhunter Programming 0 09-29-2004 05:48 AM
Have anyone experimented problems compiling programs in rh9? mkaman Red Hat 2 10-31-2003 11:41 AM
apache default inst.. Robin01 Linux - Newbie 6 09-24-2003 02:18 PM


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

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