<分区>
我在使用 curses.h 完成一些绝对的基本工作时遇到了麻烦,尽管我以前使用过它。我敢肯定这是遗漏一些小东西的经典案例,但我已经无计可施了。
G++ 绝对不会识别函数 raw() 或 cbreak(),即使 curses.h 包含在我的 .cpp 和头文件中,和编译时链接到(最小版本):
g++ debugC.cpp -lcurses
相关代码为:
#include <curses.h>
#include "debugC.h"
#include "machine.h"
using namespace std;
debugC::debugC(machine *BFM){
localMachine = BFM;
}
//entry into debugger
void debugC::start(){
void * v = NULL;
initscr();
raw();
noecho();
}
g++返回的错误:
/usr/bin/ld: /tmp/cci6mA0L.o: undefined reference to symbol 'raw'
/usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
为了清晰起见,我已将其精简为最少的功能代码。它在不调用 raw() 的情况下编译。
curses.h 显然包含在内,并且我在编译时已链接到它。它怎么可能不理解对某些 curses 函数的引用,而不理解对其他函数的引用?
我已经搜索过 SO 和 Google 寻求帮助,但我似乎找不到解决方案,我非常感谢任何可能的见解。谢谢。