views:

12

answers:

1

I get a Undefined symbols error attempting to build an XCode project, and I'm pretty sure it is because the linker can't find a library (it's the library needed to use curses.h btw). I'm writing a terminal program. The errors I'm getting are:

Undefined symbols:
  "_initscr", referenced from:
      _main in RogueSmackCmdLine.o
  "_wrefresh", referenced from:
      _main in RogueSmackCmdLine.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

and the offending lines of code are:

WINDOW *win = initscr ();
wrefresh(win);

This oughta be easy for some of you guys. Help finding the right place in the Project Settings and knowing what to put there wd be greatly appreciated.

A: 

Looks like those are from ncurses. You should right-click on your Frameworks folder in Xcode's file browser, select Add->Existing Frameworks…, and select libncurses (or libcurses) from the list.

Kevin Ballard
That did it all right. Muchas gracias. And now I have a runtime error. (sigh) It'd be nice if things would occasionally just work.
Alyoshak