我正在嘗試安裝 Oleo (http://www.gnu.org/software/oleo/)在 Cygwin 設定上遇到了一些問題。在連結階段,建立錯誤,抱怨 ncurses 中未定義的引用。我安裝了 libncurses-devel 軟體包。
我運行的建置命令是:
me@mymachine$ CFLAGS="-I/usr/include/ncurses" ./configure
[configure chatter, then success]
me@mymachine$ CFLAGS="-I/usr/include/ncurses" make
[snip successful compile...]
io-curses.o:io-curses.c:(.text+0x1ef8): undefined reference to `_ncwrap_stdscr'
io-curses.o:io-curses.c:(.text+0x1f08): undefined reference to `_wattrset'
io-curses.o:io-curses.c:(.text+0x1f45): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x1f6c): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x1f71): undefined reference to `_ncwrap_stdscr'
io-curses.o:io-curses.c:(.text+0x1f81): undefined reference to `_wattrset'
io-curses.o:io-curses.c:(.text+0x1fa6): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x206c): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x20da): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x21b2): undefined reference to `_printw'
io-curses.o:io-curses.c:(.text+0x21c9): undefined reference to `_ncwrap_stdscr'
io-curses.o:io-curses.c:(.text+0x21df): undefined reference to `_wmove'
io-curses.o:io-curses.c:(.text+0x21ec): undefined reference to `_ncwrap_stdscr'
io-curses.o:io-curses.c:(.text+0x21f4): undefined reference to `_wrefresh'
有人知道可能導致這些 ncurses 問題的原因嗎?
答案1
您可能需要新增-lcurses
或-lncurses
到 CFLAGS 才能成功編譯。