LinuxQuestions.org
Review your favorite Linux distribution.
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 04-29-2002, 06:29 AM   #1
wwnn1
Member
 
Registered: Apr 2002
Location: PRC
Posts: 32

Rep: Reputation: 15
Unhappy can you help me?


I have a programme below:

************* filename: a.c ***************
#include<curses.h>
main()
{
initscr();
........
........ /* other code */
}
*******************************************

then I input the command: gcc a.c
there are a lot of errors like this: undefined reference to 'initscr'
But
the file "curses.h" is included in '/usr/include',
and,the procedure 'initscr()' is declared in file 'curses.h' this way:
extern NCURSES_EXPORT(WINDOW *) initscr(void);

Why this error happens?
How can I correct it?
My email is: wwnn1_class@sina.com
Thanks!
 
Old 04-29-2002, 07:37 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
You need to link the curses library. Try compiling with the following command:

gcc -o programname code.c -lcurses

Usually curses is just a link to ncurses so if that doesn't work try ncurses instead.
 
  


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



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

All times are GMT -5. The time now is 07:47 PM.

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