web-dev-qa-db-ja.com

Ncurses 6.0コンパイルエラー-エラー: 'int'の前に ')'が必要です

問題の説明

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.
22
Samir Sadek

解決

次のように、-Pを使用してシェルで変数CPPFLAGSをエクスポートします

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

参照

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

34
Samir Sadek

$ export CPPFLAGS="-P"これは、Ubuntu 16.04 LTSでのncurses 6.0のローカルインストールでも機能します。

5
James Chung