conflicting types for ‘getmaxx’|conflicting types for ‘getmaxy’
- 2011-11-16 23:20 - fzblog.net
- Views: 177
- Comments: 0
- Linux
在ubuntu下安装TurboC,make的时候出现了以下错误:
在google上搜索,相关结果都没有解决办法,没办法,只好自己来解决了。
1.找到graphics.h 第485行和第489行
把这几行都注释掉后再make,又出现了错误
看来问题出现在/usr/include/ncurses.h这个头文件里面,“getmaxy"已经被graphics.h里面声明过了
2.还原graphics.h, 找到/usr/include/ncurses.h第849行:
把这两行注释掉,make
看着一行行的编译通过的代码闪过,就知道问题解决了
代码如下
- cc -O0 -g -DWITH_X -I/usr/X11R6/include -Wall -c -funsigned-char -o arc.o arc.c
- In file included from arc.c:36:0:
- graphics.h:485:12: error: conflicting types for ‘getmaxx’
- /usr/include/ncurses.h:849:28: note: previous declaration of ‘getmaxx’ was here
- graphics.h:489:12: error: conflicting types for ‘getmaxy’
- /usr/include/ncurses.h:850:28: note: previous declaration of ‘getmaxy’ was here
- make: *** [arc.o] 错误 1
-
1.找到graphics.h 第485行和第489行
代码如下
- extern int getmaxx (void);
- #ifdef getmaxy
- #undef getmaxy
- #endif
- extern int getmaxy (void);
把这几行都注释掉后再make,又出现了错误
代码如下
- getmaxx.c:35:1: error: expected identifier or ‘(’ before ‘void’
- getmaxx.c:35:1: error: expected ‘)’ before ‘?’ token
- getmaxx.c:41:1: error: conflicting types for ‘getmaxy’
- /usr/include/ncurses.h:850:28: note: previous declaration of ‘getmaxy’ was here
-
看来问题出现在/usr/include/ncurses.h这个头文件里面,“getmaxy"已经被graphics.h里面声明过了
2.还原graphics.h, 找到/usr/include/ncurses.h第849行:
代码如下
- extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */
- extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */
看着一行行的编译通过的代码闪过,就知道问题解决了



随便说说