Ncurses 6.0编译错误 - 错误:预期')'在'int'之前

Sam*_*dek 22 ncurses

问题描述

试图在Ubuntu 16.04 LTS上安装ncurses 6.0失败,出现编译错误:

In file included from ./curses.priv.h:325:0,
                 from ../ncurses/lib_gen.c:19:
_24273.c:843:15: error: expected ‘)’ before ‘int’
../include/curses.h:1631:56: note: in definition of macro ‘mouse_trafo’
#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
                                                    ^
Makefile:962: recipe for target '../objects/lib_gen.o' failed
make[1]: *** [../objects/lib_gen.o] Error 1
make[1]: Leaving directory '/home/netsamir/Sofware/Tmux/ncurses-6.0/ncurses'
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)

组态

netsamir@octopus:~/Sofware/Tmux/ncurses-6.0$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:   xenial

netsamir@octopus:~/Sofware/Tmux/ncurses-6.0$ gcc --version
gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

netsamir@octopus:~/Sofware/Tmux/ncurses-6.0$ cpp --version
cpp (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)

Sam*_*dek 34

使用-P在shell中导出变量CPPFLAGS,如下所示

netsamir@octopus:~/$ export CPPFLAGS="-P"
Run Code Online (Sandbox Code Playgroud)

参考

http://trac.sagemath.org/ticket/19762

  • 在配置之前执行此操作 (9认同)
  • 它也可以添加到configure命令中,因此它只具有临时效果.示例:./ configure <options> CPPFLAGS =" - P" (3认同)
  • @JohnMudd,那么还有'CPPFLAGS = -P./ configure`,但这依赖于拥有一个特定的shell.;-) (2认同)

小智 5

$ export CPPFLAGS="-P" 这也适用于在Ubuntu 16.04 LTS上本地安装ncurses 6.0。