Building psmisc on Solaris 7

gcc -DHAVE_CONFIG_H -I. -I. -I..      -Wall -DLOCALEDIR=\"/usr/share/locale\" -c `test -f pstree.c || echo './'`pstree.c
pstree.c:15: getopt.h: No such file or directory
pstree.c:19: termcap.h: No such file or directory

After removing include of getopt.h and termcap.h:
	functions used with no prototype:
		tgetstr
		tputs
		tgetent
	all are found curses.h or term.h
Accordign to the manpage for them, should be:
       #include 
       #include 

When I replace  with  and , I get:
/usr/include/widec.h:42: warning: `getwc' redefined
/usr/include/wchar.h:326: warning: this is the location of the previous definition

As an alternative to using /usr/include/curses.h, maybe using
/usr/xpg4/include or /usr/ucbinclude/curses.h

test program is
#include 
main()
{  printf("hello, world\n"); }


Google search for
	"wchar.h" "widec.h" "solaris 7" redefined
results were a grumbling about bugs in solaris

include tree:
pstree.c-+-stdlib.h

         +-stdio.h
         +-string.h
         +-ctype.h
         +-unistd.h
         +-fcntl.h
         +-getopt.h
         +-pwd.h
         +-dirent.h
         +-termis.h
         +-curses.h-+-widec.h-+-wchar.h
         +-...
GCC has a fixed curses.h version
ls

in widec.h:
  #ifndef _WIDEC_H
  #define _WIDEC_H
  ...
  #include 
  #if defined(__STDC__)
  #if     !defined(lint) && !defined(__lint)
  #define getwc(p)        fgetwc(p)
  #define putwc(x, p)     fputwc((x), (p))
  #define getwchar()      getwc(stdin)
  #define putwchar(x)     putwc((x), stdout)
  #endif
  ...
  #else   /* !defined(__STDC__) */
  ...
  #define getwc(p)        fgetwc(p)
  #define putwc(x, p)     fputwc((x), (p))
  #define getwchar()      getwc(stdin)
  #define putwchar(x)     putwc((x), stdout)
  ...
  #endif  /* !defined(__STDC__) */

in wchar.h:
290: #if (!defined(_MSE_INT_H))
292:   #if (!(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)))
293:     #ifdef __PRAGMA_REDEFINE_EXTNAME
303:     #else   /* __PRAGMA_REDEFINE_EXTNAME */
326: #define getwc   __getwc_xpg5
327: #define getwchar        __getwchar_xpg5
329: #define putwc   __putwc_xpg5
330: #define putwchar        __putwchar_xpg5
334:     #endif  /* __PRAGMA_REDEFINE_EXTNAME */
335:   #endif /* not XPG4 and not XPG4v2 */
336: #endif /* defined(_MSE_INT_H) */

Did a 
	fgrep MSE_INT_H `find . -type f
in /usr/include
and the only place it is used is in wchar.h

checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... yes
checking termcap.h usability... no
checking termcap.h presence... no
checking for termcap.h... no

gcc -DHAVE_CONFIG_H -I. -I. -I..      -Wall -DLOCALEDIR=\"/usr/share/locale\" -c `test -f pstree.c || echo './'`pstree.c


take out the relevant includes and get:
gcc -DHAVE_CONFIG_H -I. -I. -I..      -Wall -DLOCALEDIR=\"/usr/share/locale\" -c `test -f pstree.c || echo './'`pstree.c
pstree.c: In function `dump_tree':
pstree.c:392: warning: implicit declaration of function `tgetstr'
pstree.c:392: warning: assignment makes pointer from integer without a cast
pstree.c:393: warning: implicit declaration of function `tputs'
pstree.c:441: warning: assignment makes pointer from integer without a cast
pstree.c: In function `read_proc':
pstree.c:596: warning: int format, pid_t arg (arg 4)
pstree.c:600: warning: int format, pid_t arg (arg 4)
pstree.c:622: warning: int format, pid_t arg (arg 3)
pstree.c:637: warning: int format, pid_t arg (arg 4)
pstree.c: In function `main':
pstree.c:787: warning: implicit declaration of function `tgetent'
pstree.c:839: warning: subscript has type `char'