【发布时间】:2020-08-25 17:12:13
【问题描述】:
当我将getch() 添加到我的两个函数时,我收到错误说明:
"Undefined symbol: _stdscr" and "Undefined symbol: _wgetch"
我在 Xcode 中使用带有库 #include <curses.h> 的 MacBook
提前致谢。
【问题讨论】:
当我将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。
【讨论】: