Opened 5 months ago

Last modified 3 months ago

#70242 new defect

kcd fails to build: error: invalid use of incomplete type 'WINDOW' {aka 'struct _win_st'}

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc:
Port: kcd

Description

Build fails with gcc-4.2 with:

error: invalid use of incomplete type ‘struct _win_st’
error: forward declaration of ‘struct _win_st’

It also fails with gcc13:

--->  Building kcd
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_kcd/kcd/work/kcd-7.15.0" && /usr/bin/make -j6 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_kcd/kcd/work/kcd-7.15.0'
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./buffer.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./conffile.cc \
	       -DKCD_ETCDIR=\""/etc/opt/local"\"
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./confobj.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./cstrlib.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./dirobj.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./dirtree.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./dirutil.cc
In file included from ./confobj.cc:21:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
In file included from ./conffile.h:25,
                 from ./conffile.cc:21:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
In file included from ./conffile.h:25,
                 from ./dirtree.cc:22:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./editbox.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./error.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./gentree.cc
In file included from ./editbox.cc:22:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./gtstream.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./gzfileio.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./kcdmain.cc \
	       -DKCD_LOCALEDIR=\""/opt/local/share/locale"\"
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./khdoc.cc
In file included from ./gentree.cc:23:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./khwin.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./miscobj.cc
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./scandir.cc
In file included from ./conffile.h:25,
                 from ./kcdmain.cc:35:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
./kcdmain.cc: In function 'void mainReal(int, char**)':
./kcdmain.cc:268:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  268 |         putenv("IFS= \t\n");            // Security precaution
      |                ^~~~~~~~~~~
./kcdmain.cc:269:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  269 |         putenv("NLSPATH=");
      |                ^~~~~~~~~~
./khdoc.cc: In member function 'void HyperDocument::ProcessHypertext(char*, size_t, WINDOW*)':
./khdoc.cc:1219:56: warning: catching polymorphic type 'class ErrorRange' by value [-Wcatch-value=]
 1219 |                                                 catch (ErrorRange) {
      |                                                        ^~~~~~~~~~
In file included from ./khwin.h:36,
                 from ./khwin.cc:21:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
./khwin.cc: In member function 'virtual void HyperWindow::Init()':
./khwin.cc:442:16: error: invalid use of incomplete type 'WINDOW' {aka 'struct _win_st'}
  442 |         if (win->_line == NULL) {       // Some macros are broken due to
      |                ^~
In file included from ./setupcurses.h:31,
                 from ./khdoc.h:26,
                 from ./khwin.h:29:
/opt/local/include/curses.h:464:16: note: forward declaration of 'WINDOW' {aka 'struct _win_st'}
  464 | typedef struct _win_st WINDOW;
      |                ^~~~~~~
/opt/local/bin/g++-mp-13 -I. -I/opt/local/include -pipe -Os -arch ppc -W -Wall -c ./scrnman.cc
make: *** [khwin.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./conffile.h:25,
                 from ./scandir.cc:28:
./confobj.h:75:25: warning: 'virtual bool DirConfig::operator==(const DirConfig&) const' was hidden [-Woverloaded-virtual=]
   75 |         virtual bool    operator ==(const DirConfig& d) const {
      |                         ^~~~~~~~
./confobj.h:92:25: note:   by 'virtual bool MountDirConfig::operator==(const MountDirConfig&) const'
   92 |         virtual bool    operator ==(const MountDirConfig& d) const {
      |                         ^~~~~~~~
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_kcd/kcd/work/kcd-7.15.0'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_kcd/kcd/work/kcd-7.15.0" && /usr/bin/make -j6 -w all 
Exit code: 2
Error: Failed to build kcd: command execution failed

Change History (3)

comment:1 Changed 5 months ago by barracuda156

See also: #70241

comment:2 Changed 3 months ago by barracuda156

Both ports still fail to build.

comment:3 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

According to https://groups.google.com/g/linux.debian.bugs.dist/c/lBayEfISTCY this is because of a change in ncurses that makes that structure opaque. An accessor function must now be used. It's not a MacPorts-specific problem so if upstream still exists, report it to them or see if they already have a fix. If not, see if another distribution already has a fix.

Note: See TracTickets for help on using tickets.