Author Topic: Nightly r12709 is broken macOS  (Read 2402 times)

Offline steve123

  • Single posting newcomer
  • *
  • Posts: 3
Nightly r12709 is broken macOS
« on: February 09, 2022, 04:22:38 pm »
I attempted to compile the r12709 nightly and encountered the following build error when compiling on macOS 11.6.2.  It appears a recent change is incorrectly using GetBitmapFor().  That particular function is a member of wxBitmapBundle, not wxBitmap?

BTW, I am new here, is there a code tags feature for this forum editor?  I couldn't find one so I just pasted the text output below without using code tags.


   clang++ -DHAVE_CONFIG_H -I. -I../../src/include  -I/Users/stevenslupsky/Documents/source/codeblocks-r12709/install_dir/lib/wx/include/osx_cocoa-unicode-3.1 -I/Users/stevenslupsky/Documents/source/codeblocks-r12709/install_dir/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__  -I../../src/include/scripting/include -I../../src/sdk/wxscintilla/include -I../../src/include  -DCB_AUTOCONF -stdlib=libc++ -DCB_PRECOMP -DPIC -I../../src/include/tinyxml -DTIXML_USE_STL=YES  -stdlib=libc++ -std=c++14 -Winvalid-pch -fPIC -fexceptions -MT printdlg.o -MD -MP -MF $depbase.Tpo -c -o printdlg.o printdlg.cpp &&\
   mv -f $depbase.Tpo $depbase.Po
notebookstyles.cpp:130:40: error: no member named 'GetBitmapFor' in 'wxBitmap'
        const wxBitmap bmp(page.bitmap.GetBitmapFor(wnd));
                           ~~~~~~~~~~~ ^
notebookstyles.cpp:179:36: error: no member named 'GetBitmapFor' in 'wxBitmap'
            bmp = m_activeCloseBmp.GetBitmapFor(wnd);
                  ~~~~~~~~~~~~~~~~ ^
notebookstyles.cpp:181:38: error: no member named 'GetBitmapFor' in 'wxBitmap'
            bmp = m_disabledCloseBmp.GetBitmapFor(wnd);
                  ~~~~~~~~~~~~~~~~~~ ^
notebookstyles.cpp:316:40: error: no member named 'GetBitmapFor' in 'wxBitmap'
        const wxBitmap bmp(page.bitmap.GetBitmapFor(wnd));
                           ~~~~~~~~~~~ ^
notebookstyles.cpp:364:36: error: no member named 'GetBitmapFor' in 'wxBitmap'
            bmp = m_activeCloseBmp.GetBitmapFor(wnd);
                  ~~~~~~~~~~~~~~~~ ^
notebookstyles.cpp:366:38: error: no member named 'GetBitmapFor' in 'wxBitmap'
            bmp = m_disabledCloseBmp.GetBitmapFor(wnd);
                  ~~~~~~~~~~~~~~~~~~ ^
6 errors generated.
make[3]: *** [notebookstyles.o] Error 1

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1205
Re: Nightly r12709 is broken macOS
« Reply #1 on: February 09, 2022, 05:44:30 pm »
That code is compiled only if you are using wxWidgets 3.1.6 or newer:
Code
#if wxCHECK_VERSION(3, 1, 6)
        if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
                    (close_button_state == wxAUI_BUTTON_STATE_PRESSED))
            bmp = m_activeCloseBmp.GetBitmapFor(wnd);
        else
            bmp = m_disabledCloseBmp.GetBitmapFor(wnd);
#else
        if ((close_button_state == wxAUI_BUTTON_STATE_HOVER) ||
                    (close_button_state == wxAUI_BUTTON_STATE_PRESSED))
            bmp = m_activeCloseBmp;
        else
            bmp = m_disabledCloseBmp;
#endif

EDIT: Probably you must update wxWidgets to a recent (< 1 month) version or use wx3.1.5 (better option). wxBitmapBundle was added about 4 months ago.
« Last Edit: February 09, 2022, 06:13:30 pm by Miguel Gimenez »

Offline steve123

  • Single posting newcomer
  • *
  • Posts: 3
Re: Nightly r12709 is broken macOS
« Reply #2 on: February 09, 2022, 07:23:53 pm »
Yes, I have 3.1.6 installed and it breaks because GetBitmapFor() is actually a member of wxBitmapBundle, not wxBitmap.  So, the usage is incorrect.

For the time begin, I just replace
#if wxCHECK_VERSION(3, 1, 6)

with
#if (0)

to disable this code.  It compiles and appears to run ... though it crashed when I closed the app.
« Last Edit: February 09, 2022, 07:25:42 pm by steve123 »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1205
Re: Nightly r12709 is broken macOS
« Reply #3 on: February 09, 2022, 07:47:11 pm »
3.1.6 is still a work-in-progress, not a release.

The usage is not incorrect, you need to pull a snapshot newer than this commit from 14-Nov-2021.

Offline steve123

  • Single posting newcomer
  • *
  • Posts: 3
Re: Nightly r12709 is broken macOS
« Reply #4 on: February 10, 2022, 07:31:42 pm »
Ahh, I see that commit addresses this.  Thank you for the tip.