Author Topic: cb trunk compile error; missing #include in wxspropertygridmanager.h  (Read 3168 times)

Offline blauzahn

  • Almost regular
  • **
  • Posts: 151
Hello,

when compiling cb-trunk with wxWidgets trunk on Linux (arch) I got a compile error. This started around Mar 10th and has been the same since.

adding
Code
#include <wx/textctrl.h>

to src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.h
fixes this.

Have a nice day.


Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1486
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #1 on: April 02, 2023, 10:06:17 am »
Can you post the error?

Offline blauzahn

  • Almost regular
  • **
  • Posts: 151
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #2 on: April 02, 2023, 11:27:36 am »
As usual, I compile via configure and make using an out-of-tree build directory parallel to trunk. The current wxWidgets trunk installation resides in /op/wx so that it does not collide with the default installed one.

The configure command I have in my Makefile above trunk is:
Code
mkdir -p build
(cd build && \
  LT_SYS_LIBRARY_PATH=/opt/wx/lib \
  CC=cc CXX=g++ ../trunk/configure \
  --prefix=/usr/local \
  --with-wx-config=/opt/wx/bin/wx-config --with-wx-prefix=/opt/wx \
    --disable-code-completion \
  --with-contrib-plugins=all,-NassiShneiderman,-codesnippets)


error:

Code
Making all in wxSmith
make[5]: Entering directory '/home/xyz/software/codeblocks/build/src/plugins/contrib/wxSmith'
Making all in properties
make[6]: Entering directory '/home/xyz/software/codeblocks/build/src/plugins/contrib/wxSmith/properties'
depbase=`echo wxspropertygridmanager.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ../../../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../../../trunk/src/plugins/contrib/wxSmith/properties -I../../../../../src/include  -I/opt/wx/lib/wx/include/gtk3-unicode-3.3 -I/opt/wx/include/wx-3.3 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../../../trunk/src/include -I../../../../../../trunk/src/sdk/wxscintilla/include -DCB_AUTOCONF  -DCB_PRECOMP -DPIC -I../../../../../../trunk/src/include/tinyxml -DTIXML_USE_STL=YES  -O2 -ffast-math  -Winvalid-pch -fPIC -fexceptions -MT wxspropertygridmanager.lo -MD -MP -MF $depbase.Tpo -c -o wxspropertygridmanager.lo ../../../../../../trunk/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../../../../trunk/src/plugins/contrib/wxSmith/properties -I../../../../../src/include -I/opt/wx/lib/wx/include/gtk3-unicode-3.3 -I/opt/wx/include/wx-3.3 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../../../trunk/src/include -I../../../../../../trunk/src/sdk/wxscintilla/include -DCB_AUTOCONF -DCB_PRECOMP -DPIC -I../../../../../../trunk/src/include/tinyxml -DTIXML_USE_STL=YES -O2 -ffast-math -Winvalid-pch -fPIC -fexceptions -MT wxspropertygridmanager.lo -MD -MP -MF .deps/wxspropertygridmanager.Tpo -c ../../../../../../trunk/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp  -fPIC -DPIC -o .libs/wxspropertygridmanager.o
In file included from ../../../../../../trunk/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.h:34,
                 from ../../../../../../trunk/src/plugins/contrib/wxSmith/properties/wxspropertygridmanager.cpp:23:
/opt/wx/include/wx-3.3/wx/propgrid/propgrid.h:764:5: error: 'wxTextCtrl' does not name a type; did you mean 'wxTextEntry'?
  764 |     wxTextCtrl* GetEditorTextCtrl() const;
      |     ^~~~~~~~~~
      |     wxTextEntry
/opt/wx/include/wx-3.3/wx/propgrid/propgrid.h:892:5: error: 'wxTextCtrl' does not name a type; did you mean 'wxTextEntry'?
  892 |     wxTextCtrl* GetLabelEditor() const
      |     ^~~~~~~~~~
      |     wxTextEntry
/opt/wx/include/wx-3.3/wx/propgrid/propgrid.h:1547:5: error: 'wxTextCtrl' does not name a type; did you mean 'wxTextEntry'?
 1547 |     wxTextCtrl*         m_labelEditor;
      |     ^~~~~~~~~~
      |     wxTextEntry
make[6]: *** [Makefile:656: wxspropertygridmanager.lo] Error 1
make[6]: Leaving directory '/home/xyz/software/codeblocks/build/src/plugins/contrib/wxSmith/properties'
make[5]: *** [Makefile:836: all-recursive] Error 1
make[5]: Leaving directory '/home/xyz/software/codeblocks/build/src/plugins/contrib/wxSmith'
make[4]: *** [Makefile:641: all-recursive] Error 1
make[4]: Leaving directory '/home/xyz/software/codeblocks/build/src/plugins/contrib'
make[3]: *** [Makefile:535: all-recursive] Error 1
make[3]: Leaving directory '/home/xyz/software/codeblocks/build/src/plugins'
make[2]: *** [Makefile:542: all-recursive] Error 1
make[2]: Leaving directory '/home/xyz/software/codeblocks/build/src'
make[1]: *** [Makefile:674: all-recursive] Error 1
make[1]: Leaving directory '/home/xyz/software/codeblocks/build'
make: *** [Makefile:66: all] Error 2

I just changed the name of the home-directory for privacy.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1486
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #3 on: April 02, 2023, 11:49:35 am »
Looks like this is a wxWidgets issue, propgrid.h should include textctrl.h and do not depend on other code including it.

I will report this on the wx site so the 3.3 release hopefully includes it.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 151
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #4 on: April 02, 2023, 12:10:24 pm »
propgrid.h contains wxTextCtrl only as a pointer. A forward declaration would suffice there. Granted, those translation units that actually ODR-use wxTextCtrl would still have to  #include it.

I like minimized coupling and compiletime.

Anyway. Let's see what the wxWidgets maintainer's opinion is.

Thank you for having looked into this.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1486
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #5 on: April 04, 2023, 05:19:45 pm »
Fixed in wxWidgets' trunk using a forward declaration.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 151
Re: cb trunk compile error; missing #include in wxspropertygridmanager.h
« Reply #6 on: April 04, 2023, 07:36:15 pm »
I can confirm that it is fixed. cb vanilla trunk compiles again with wxWidgets trunk.

Thanks again.