【问题标题】:Ncurses 6.0 Compilation Error - error: expected ')' before 'int'Ncurses 6.0 编译错误 - 错误:在 'int' 之前需要 ')'
【发布时间】:2016-05-27 05:04:00
【问题描述】:

问题描述

尝试在 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

配置

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.

【问题讨论】:

  • 这是几个月前 bug-ncurses 邮件列表中的 reportedfixed。问题出在 Debian 的 mawk 版本上。
  • Thomas Dickey 的回答实际上为我解决了问题,这与接受的 OP 回答不同。我只是通过编辑MKlib_gen.sh 来破解the fix,使得PRG=gcc 代替涉及awk 的子shell。

标签: ncurses


【解决方案1】:

解决方案

在shell中用-P导出变量CPPFLAGS如下

netsamir@octopus:~/$ export CPPFLAGS="-P"

参考

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

【讨论】:

  • 在配置之前执行此操作
  • 也可以添加到configure命令中,只起到临时作用。示例:./configure CPPFLAGS="-P"
  • @JohnMudd,然后还有CPPFLAGS=-P ./configure,但这依赖于具有特定的外壳。 ;-)
【解决方案2】:

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

【讨论】:

  • 谢谢,老兄。我正在寻找代码亮点的文档。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-02
  • 1970-01-01
  • 2010-12-26
  • 2017-05-20
  • 2021-07-26
  • 1970-01-01
相关资源
最近更新 更多