关于 ncurses编译错误问题
配置命令:./configure --prefix=/home/daxiangzizi/daxiangzizi/install/ncurses/ncurses --host=arm-linuxgnueabihf --target=arm-linux-gnueabihf --with-shared --without-profile --disable-stripping --without-progs --with-manpages --without-tests
配置完成直接编译后,出现如下错误
arm-linux-gnueabi-gcc -DHAVE_CONFIG_H -I../ncurses -I. -I/home/charles/code/build_systemd/_install/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -I. -I../include -I/home/charles/code/build_systemd/_install/include/ncurses -I/home/charles/code/build_systemd/_install/include --param max-inline-insns-single=1200 -c ../ncurses/lib_gen.c -o ../objects/lib_gen.o
In file included from ../ncurses/curses.priv.h:283:0,
from ../ncurses/lib_gen.c:19:
_32053.c:835:15: error: expected ')' before 'int'
../include/curses.h:1594:56: note: in definition of macro 'mouse_trafo'
#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
^
Makefile:785: recipe for target '../objects/lib_gen.o' failed
根据网友提醒,发现要先将配置导出
export CPPFLAGS="-P"
然后在配置一次./configure --prefix=/home/daxiangzizi/daxiangzizi/install/ncurses/ncurses --host=arm-linuxgnueabihf --target=arm-linux-gnueabihf --with-shared --without-profile --disable-stripping --without-progs --with-manpages --without-tests
最后make编译,成功。