Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#185 xcurses build from source uses wrong curses.h

open
nobody
None
5
2010-06-14
2010-06-14
D.M.Wooster
No

When building from source, three places reference curses.h: the configure script, the.h, and getch.c. getch.c and the configure script both look for xcurses.h, when building for X11, but the.h still looks for curses.h. PDCurses provides an xcurses.h and an identical xcurses/curses.h . If you tell the configure script to use --with-cursesincdir=/op/include/xcurses then it complains that xcurses.h isn't found. But if you --with-cursesincdir=/opt/include then commutil.c fails to build, due to getting the wrong curses.h. Hundreds of lines of output similar to:

<pre>
gcc -c -O2 -m64 -O3 -Wall -fomit-frame-pointer -fno-strict-aliasing -Wno-char-subscripts -I. -I.. -DNDEBUG -DHAVE_CONFIG_H -DTHE_HOME_DIRECTORY=\"/r/ge.unx.sas.com/vol/vol101/u101/dowoos/THE/opt/share/THE/\" -I/r/ge.unx.sas.com/vol/vol101/u101/dowoos/THE/opt/include -DLINUX -I/r/ge.unx.sas.com/vol/vol101/u101/dowoos/THE/opt/include -o commutil.o ../commutil.c
In file included from ../commutil.c:41:
../key.h:239: error: `PADPLUS' undeclared here (not in a function)
../key.h:239: error: initializer element is not constant
../key.h:239: error: (near initialization for `key_table[184].key_value')
../key.h:239: error: initializer element is not constant
../key.h:239: error: (near initialization for `key_table[184]')
../key.h:240: error: `PADMINUS' undeclared here (not in a function)
../key.h:240: error: initializer element is not constant
../key.h:240: error: (near initialization for `key_table[185].key_value')
../key.h:240: error: initializer element is not constant
../key.h:240: error: (near initialization for `key_table[185]')
</pre>

Line 40 of the.h should be changed from
# include <curses.h>
to
# include <xcurses.h>

Discussion