Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top