LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem compiling programs using ncurses library (gcc 3.2.2 and RH9 default inst.) (https://www.linuxquestions.org/questions/linux-newbie-8/problem-compiling-programs-using-ncurses-library-gcc-3-2-2-and-rh9-default-inst-205132/)

jclark7777 07-14-2004 07:05 PM

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!

rylan76 07-20-2004 01:59 PM

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.


All times are GMT -5. The time now is 06:27 PM.