问题描述
当我将getch()
添加到两个函数中时,出现错误提示:
"Undefined symbol: _stdscr" and "Undefined symbol: _wgetch"
我正在使用带有Xcode库#include <curses.h>
的MacBook
谢谢。
解决方法
在编译时只需添加-lcurses
选项(链接指令)即可。
例如:clang++ main.cpp -o main -lcurses
如果您使用的是make
,则将LDLIBS = -lcurses
添加到您的makefile
。
我刚刚注意到您正在使用XCode。因此,您可以在这里:Linking Libraries in Xcode。只需将答案中的-lfftw3
替换为-lcurses
。