LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2004, 09:00 PM   #1
jclark7777
LQ Newbie
 
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
ncurses compile-time problems


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-16-2004, 10:40 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Are you using a Makefile, or compiling the source code "by hand" with a command at a terminal?

If compiling from the terminal, then make sure you have:

-lncurses

as one of the options to gcc. You have to explicitly tell the compiler to use an external library with the -l option. Using the #include directive is only half of what you need to get going...
 
Old 07-17-2004, 08:12 AM   #3
jclark7777
LQ Newbie
 
Registered: Jul 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the information. I had no idea that was necessary
The code works now.

Once again, thank you.
 
  


Reply



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
kernel compile time and boot time lordofring Programming 1 11-13-2005 02:04 AM
Problem at compile time!! juanjavier_xxx Linux - Newbie 7 09-04-2004 04:22 PM
Trying to compile for first time Please Help Viper Linux - Software 18 08-15-2003 11:29 PM
ncurses compile error: "undefined reference" Mr. Eek Linux From Scratch 1 05-12-2003 04:25 PM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 12:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:26 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
Open Source Consulting | Domain Registration