I downloaded the .pkg installer from this site, and it installed fine (to my knowledge, at least), but I run into several errors when I try to compile a program using the library. If I link it with -lcurses, I get...code:
cc -c main.c
cc -o test main.o -lcurses
/usr/bin/ld: Undefined symbols:
_init_pair
_start_color
_wattr_off
_wattr_on
make: *** [test] Error 1
...which seems right, since I'm using the pre-ncurses library. If I instead link it with -lncurses, I get the following mess:
code:
cc -c main.c
cc -o test main.o -lncurses
/usr/bin/ld: warning unused multiple definitions of symbol _COLS
/usr/local/lib/libncurses.dylib(lib_setup.o) definition of _COLS
/usr/lib/libSystem.dylib(curses.o) unused definition of _COLS
/usr/bin/ld: warning unused multiple definitions of symbol _LINES
/usr/local/lib/libncurses.dylib(lib_setup.o) definition of _LINES
/usr/lib/libSystem.dylib(curses.o) unused definition of _LINES
/usr/bin/ld: warning unused multiple definitions of symbol _endwin
/usr/local/lib/libncurses.dylib(lib_endwin.o) definition of _endwin
/usr/lib/libSystem.dylib(tty.o) unused definition of _endwin
/usr/bin/ld: warning unused multiple definitions of symbol _initscr
/usr/local/lib/libncurses.dylib(lib_initscr.o) definition of _initscr
/usr/lib/libSystem.dylib(initscr.o) unused definition of _initscr
/usr/bin/ld: warning unused multiple definitions of symbol _mvcur
/usr/local/lib/libncurses.dylib(lib_mvcur.o) definition of _mvcur
/usr/lib/libSystem.dylib(cr_put.o) unused definition of _mvcur
/usr/bin/ld: warning unused multiple definitions of symbol _noecho
/usr/local/lib/libncurses.dylib(lib_echo.o) definition of _noecho
/usr/lib/libSystem.dylib(tty.o) unused definition of _noecho
/usr/bin/ld: warning unused multiple definitions of symbol _raw
/usr/local/lib/libncurses.dylib(lib_raw.o) definition of _raw
/usr/lib/libSystem.dylib(tty.o) unused definition of _raw
/usr/bin/ld: warning unused multiple definitions of symbol _stdscr
/usr/local/lib/libncurses.dylib(lib_data.o) definition of _stdscr
/usr/lib/libSystem.dylib(curses.o) unused definition of _stdscr
/usr/bin/ld: warning unused multiple definitions of symbol _waddch
/usr/local/lib/libncurses.dylib(lib_addch.o) definition of _waddch
/usr/lib/libSystem.dylib(addch.o) unused definition of _waddch
/usr/bin/ld: warning unused multiple definitions of symbol _waddnstr
/usr/local/lib/libncurses.dylib(lib_addstr.o) definition of _waddnstr
/usr/lib/libSystem.dylib(addnstr.o) unused definition of _waddnstr
/usr/bin/ld: warning unused multiple definitions of symbol _wgetch
/usr/local/lib/libncurses.dylib(lib_getch.o) definition of _wgetch
/usr/lib/libSystem.dylib(getch.o) unused definition of _wgetch
/usr/bin/ld: warning unused multiple definitions of symbol _wmove
/usr/local/lib/libncurses.dylib(lib_move.o) definition of _wmove
/usr/lib/libSystem.dylib(move.o) unused definition of _wmove
/usr/bin/ld: warning unused multiple definitions of symbol _wrefresh
/usr/local/lib/libncurses.dylib(lib_refresh.o) definition of _wrefresh
/usr/lib/libSystem.dylib(refresh.o) unused definition of _wrefresh
/usr/bin/ld: warning unused multiple definitions of symbol _ttytype
/usr/local/lib/libncurses.dylib(lib_setup.o) definition of _ttytype
/usr/lib/libSystem.dylib(setterm.o) unused definition of _ttytype
/usr/bin/ld: warning unused multiple definitions of symbol _curscr
/usr/local/lib/libncurses.dylib(lib_data.o) definition of _curscr
/usr/lib/libSystem.dylib(curses.o) unused definition of _curscr
/usr/bin/ld: warning unused multiple definitions of symbol _tputs
/usr/local/lib/libncurses.dylib(lib_tputs.o) definition of _tputs
/usr/lib/libSystem.dylib(tputs.o) unused definition of _tputs
/usr/bin/ld: warning unused multiple definitions of symbol _echo
/usr/local/lib/libncurses.dylib(lib_echo.o) definition of _echo
/usr/lib/libSystem.dylib(tty.o) unused definition of _echo
/usr/bin/ld: warning unused multiple definitions of symbol _cbreak
/usr/local/lib/libncurses.dylib(lib_raw.o) definition of _cbreak
/usr/lib/libSystem.dylib(tty.o) unused definition of _cbreak
/usr/bin/ld: warning unused multiple definitions of symbol _noraw
/usr/local/lib/libncurses.dylib(lib_raw.o) definition of _noraw
/usr/lib/libSystem.dylib(tty.o) unused definition of _noraw
/usr/bin/ld: warning unused multiple definitions of symbol _nocbreak
/usr/local/lib/libncurses.dylib(lib_raw.o) definition of _nocbreak
/usr/lib/libSystem.dylib(tty.o) unused definition of _nocbreak
/usr/bin/ld: warning unused multiple definitions of symbol _wclrtoeol
/usr/local/lib/libncurses.dylib(lib_clreol.o) definition of _wclrtoeol
/usr/lib/libSystem.dylib(clrtoeol.o) unused definition of _wclrtoeol
/usr/bin/ld: warning unused multiple definitions of symbol _PC
/usr/local/lib/libncurses.dylib(lib_tputs.o) definition of _PC
/usr/lib/libSystem.dylib(curses.o) unused definition of _PC
/usr/bin/ld: warning unused multiple definitions of symbol _ospeed
/usr/local/lib/libncurses.dylib(lib_tputs.o) definition of _ospeed
/usr/lib/libSystem.dylib(tputs.o) unused definition of _ospeed
/usr/bin/ld: warning unused multiple definitions of symbol _resetty
/usr/local/lib/libncurses.dylib(lib_ttyflags.o) definition of _resetty
/usr/lib/libSystem.dylib(tty.o) unused definition of _resetty
/usr/bin/ld: warning unused multiple definitions of symbol _savetty
/usr/local/lib/libncurses.dylib(lib_ttyflags.o) definition of _savetty
/usr/lib/libSystem.dylib(tty.o) unused definition of _savetty
/usr/bin/ld: warning unused multiple definitions of symbol _idlok
/usr/local/lib/libncurses.dylib(lib_options.o) definition of _idlok
/usr/lib/libSystem.dylib(idlok.o) unused definition of _idlok
/usr/bin/ld: warning unused multiple definitions of symbol _newwin
/usr/local/lib/libncurses.dylib(lib_newwin.o) definition of _newwin
/usr/lib/libSystem.dylib(newwin.o) unused definition of _newwin
/usr/bin/ld: warning unused multiple definitions of symbol _nl
/usr/local/lib/libncurses.dylib(lib_nl.o) definition of _nl
/usr/lib/libSystem.dylib(tty.o) unused definition of _nl
/usr/bin/ld: warning unused multiple definitions of symbol _subwin
/usr/local/lib/libncurses.dylib(lib_newwin.o) definition of _subwin
/usr/lib/libSystem.dylib(newwin.o) unused definition of _subwin
/usr/bin/ld: warning unused multiple definitions of symbol _nonl
/usr/local/lib/libncurses.dylib(lib_nl.o) definition of _nonl
/usr/lib/libSystem.dylib(tty.o) unused definition of _nonl
I get the same output regardless of whether I use <curses.h> or <ncurses.h>. I checked /usr/local/include/ and I found two identical header files with the respective names. Perhaps the original <curses.h> header file in /usr/include/ is getting passed up for the new one installed with ncurses? Could this have something to do with my problem?
Trevor Smith
trevorsm@cox.net