error while compiling c program

balam_in
balam_in used Ask the Experts™
on
#include "curses.h"
main()
{
 WINDOW *win;
win=newwin(20, 20, 20, 20);
}
while compiling this i am getting error
Undefined                       first referenced
 symbol                             in file
newwin                              2.o
ld: fatal: Symbol referencing errors. No output written to 2

can any one tell why this coming  the specified function is there in curses.h file
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
did you compile it with -lcurses
CEO/Programmer
Commented:
It's not a compilation error but a linking error. Ozo is
probably right in -lcurses but it may be ncurses on your box or you do not have installed it at all. You have to search for libcurses.a or libncurses.a if it's not there you have to install it and than your do. You may have to inform the Compiler/linker too in which directory that library really is

gcc my_program -Ldirectory_in_which_libncurses.a_is -lncurses

BTW it is not main() it's int main(void)

Regards
Friedrich

Author

Commented:
thank you very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial