Ncurses 6.0 Compilation Error - error: expected ')' before 'int'

14,341

Solution 1

Solution

Export the variable CPPFLAGS in the shell with -P as follow

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

Reference

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

Solution 2

$ export CPPFLAGS="-P" This works for my local install of ncurses 6.0 on Ubuntu 16.04 LTS as well.

Share:
14,341

Related videos on Youtube

Samir Sadek
Author by

Samir Sadek

Updated on June 06, 2022

Comments

  • Samir Sadek
    Samir Sadek about 2 years

    Problem description

    Trying to install ncurses 6.0 on Ubuntu 16.04 LTS is failing with a compilation error:

    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
    

    Configuration

    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.
    
    • Thomas Dickey
      Thomas Dickey almost 8 years
      This was reported and fixed on the bug-ncurses mailing list several months before. The problem was Debian's version of mawk.
    • jyalim
      jyalim almost 8 years
      Thomas Dickey's answer actually led to a fix for me, unlike the accepted answer to OP. I simply hacked the fix by editing MKlib_gen.sh such that PRG=gcc in place of the subshell involving awk.
  • James Chung
    James Chung almost 8 years
    Thanks, TheDude. I was looking for the documentation for code highlights.
  • iamgr007
    iamgr007 almost 8 years
    do this before configuring
  • JohnMudd
    JohnMudd over 7 years
    It can also be added to the configure command so it only has temporary effect. Example: ./configure <options> CPPFLAGS="-P"
  • jpaugh
    jpaugh over 7 years
    @JohnMudd, well then there's also CPPFLAGS=-P ./configure, but that relies on having a particular shell. ;-)