Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

compile issue with wx 3.1.6

<< < (2/3) > >>

kipade:
Yes, this option do really works for it. Thanks

Miguel Gimenez:
I have just created a ticket on wxWidgets bug tracker.

Miguel Gimenez:
@kipade, wxWidgets devs are asking for a quick check, can you do it?. I don't have GCC11.

https://trac.wxwidgets.org/ticket/19266

This is the code to compile:


--- Code: ---// This is a compilation-time-only test: just check that a class inheriting
// from wxEvtHandler non-publicly can use Bind() with its method, this used to
// result in compilation errors.
// Note that this test will work only on C++11 compilers, so we test this only
// for such compilers.
#if __cplusplus >= 201103
class HandlerNonPublic : protected wxEvtHandler
{
public:
    HandlerNonPublic()
    {
        Bind(wxEVT_IDLE, &HandlerNonPublic::OnIdle, this);
    }

    void OnIdle(wxIdleEvent&) { }
};
#endif // C++11

--- End code ---

EDIT: You can use the attached minimal wxWidgets project, it includes the code above. It is a MSW project, but can be easily adapted to Linux.

Miguel Gimenez:
There is another question in the ticket about the output of this code:


--- Code: ---#include <iostream>

int main()
{
    std::cout << "__cplusplus= " << __cplusplus << std::endl;
    return (int)__cplusplus;
}

--- End code ---

Miguel Gimenez:
The solution for this issue is Use Bind() instead of Connect(), as indicated in this wxWidgets ticket.

Following the ticket, documentation for Connect() has been updated to remark that it can be used only with methods of classes publicly inheriting from wxEvtHandler. CCManager derives privately from wxEvtHandler, so it should be modified to use Bind() or change visibility of wxEvtHandler.

I will try to make a patch this week using the first option.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version