【发布时间】:2012-05-02 14:17:03
【问题描述】:
我在这个网站上查看了类似的问题,并用谷歌搜索了为什么会发生这种情况,但尝试了这些解决方案not able to compile、difference between ncurses and curses、another compile error,但我仍然遇到错误undefined reference to stdscr 和@ 的问题987654325@ 编译器正在查找库,因为我使用find 来定位curses 库并在#include 行中输入完整位置。
我的代码如下
#include <ncurses.h>
#include <stdio.h>
#include <string.h>
int first_line(char);
int main(){
char c = 0;
while((c = getch())!=EOF){
first_line(c);
}
return 0;
}
int first_line(char c){
if (c != '\n' && c != '\r'){
putchar(c);
do{
c = getch();
putchar(c);}
while( c !='\n');
}
else return 0;
return 0;
}
如果您能指出我错过了什么或做错了什么,我将不胜感激。
【问题讨论】:
标签: c compiler-errors ncurses