Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: gd_on on April 10, 2020, 07:11:42 pm

Title: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: gd_on on April 10, 2020, 07:11:42 pm
When I try to compile C::B with wx-master (wxWidgets 3.1.4), I have a compilation error within the contrib plugin wxLEDPanel.
The problem is at line 361 in wxledpanel.cpp. Probably linked to recent changes in wxanimation.
It can be solved by not declaring wxAnimation as const.
See proposed patch.
Nevertheless, I'm not sure it's the best solution.
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: stahta01 on April 10, 2020, 09:34:27 pm
I am guessing this is the git commit you are talking about:

Code: [Select]
commit 902a2f08859a0d912aff0562cdaea5a63560124a
Author: Paul Cornett <[email protected]>
Date:   Mon Apr 6 20:26:49 2020 -0700

    Remove wxAnimation copy ctor and copy-assignment operator implementations

    The compiler-generated defaults will do the same thing

Edit: Looks like there was a very long list of wxAnimation changes right before this most recent change.

Tim S.
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: oBFusCATed on April 11, 2020, 12:11:20 am
Probably someone should report it :)
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: stahta01 on April 11, 2020, 01:34:10 am
Adding compiler option "-fpermissive" made it avoid the error.

We really need someone who uses the code to test to verify any possible fix.

This is the line with the problem for me.
Code: [Select]
m_content_mo.Init(ani.GetFrame(0));

Tim S.
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: gd_on on April 11, 2020, 09:46:12 am
OK. Same line for me (line 361 as told in my 1st post).
There were a lot of modifications in wxAnimation, introduced with the last git branch merge (07/04/2020). It's not only the very last modification concerning ctor, dtor ... which introduced this behaviour.
The -fpermissive flag is effectively suggested by the error code, but as wxledpanel is in a pack of plugins compiled together, I suppose that you put it at a relatively high level. So this flag affects also other plugins I suppose. Could it be a future source of problems ?

gd_on
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: stahta01 on April 12, 2020, 02:43:40 pm
Possible solution is to change

Code: [Select]
m_content_mo.Init(ani.GetFrame(0));
to

Code: [Select]
m_content_mo.Init(m_ani.GetFrame(0));

Tim S.
Title: Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: Miguel Gimenez on April 12, 2020, 06:34:06 pm
The constness of GetFrame() has just been restored in wxTrunk, so there is no need to change wxLedPanel's code.

Commit: https://github.com/wxWidgets/wxWidgets/commit/ed077e17cff6aa823c9547d3052a089f3789bd7e (https://github.com/wxWidgets/wxWidgets/commit/ed077e17cff6aa823c9547d3052a089f3789bd7e)
Ticket: https://trac.wxwidgets.org/ticket/18725 (https://trac.wxwidgets.org/ticket/18725)
Title: [solved] Re: wxLedPanel compilation problem with wxWidgets 3.1.4 (wx-master)
Post by: gd_on on April 13, 2020, 11:17:08 am
I have seen that this morning. Looks OK.
Original C::B code works again. Cool  8)