Author Topic: Patches to compile and link C::B against wxWidgets 2.8.0  (Read 87311 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #15 on: November 24, 2006, 03:19:20 am »
Why do we need WXWIN_COMPATIBILITY_2_4? C::B won't even compile with that version of wx........

By default wxWidgets sets a flag for compatibility to the last version in setup.h.

wx26 has WXWIN_COMPATIBILITY_2_4 set to 1

wx28 has WXWIN_COMPATIBILITY_2_4 set to 0 and WXWIN_COMPATIBILITY_2_6 set to 1

So code::blocks current dll is compiled with WXWIN_COMPATIBILITY_2_4 set to 1.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

sethjackson

  • Guest
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #16 on: November 24, 2006, 03:28:27 am »
Oh ok. Thanks. :)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #17 on: November 24, 2006, 10:11:24 am »
We can just turn it on for just 2.6; 2.8 has it off by default. I think it will require more work if we don't turn it off for 2.6 but the amount of work won't be that much. Just some #ifdef blocks in codeblocks.

From a user point of view having it on for 2.6 and off for 2.8 will be the simplest way. I will work on a patch to fix code::blocks so it works both with WXWIN_COMPATIBILITY_2_4 on or off.

This would the best solution, since it would mean that Code::Blocks would work with both default wxWidgets 2.6 and default wxWidgets 2.8 without any modifications.

Of course, if we have any of our own code that still uses wxWidgets 2.4 methods then we should strive to update those to 2.6. We should survive 2.4 compat, but not require it...

first of all, let's see what wx 2.8 brings . Will it fix some of the bugs we are suffering from the 2.6, if yes, then it light be interesting to use 2.8. If not, then might be best to wait.

wxWidgets 2.6 already has some showstopper bugs, but those can be fixed with patches (or with wxWidgets 2.6.4) so that in itself is not reason enough I think.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #18 on: November 24, 2006, 11:08:51 am »
FYI:

The only thing that seems to need WXWIN_COMPATIBILITY_2_4 set to 1 is the use of wxHIDE_READONLY. I have submitted a patch to guard all the locations that it is used in.
Tim S

Patches to core Code::Blocks project and contrib Code::Blocks workspace:
 [ Patch #1655 ] wxHIDE_READONLY patch for wxWidgets 2.7 Submitted By: stahta01
   https://developer.berlios.de/patch/?func=detailpatch&patch_id=1655&group_id=5358

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #19 on: November 24, 2006, 11:56:07 am »
Just a note: discussions to switch C::B development to wx2.8 are pointless. wx2.8 will take quite a while to enter the major linux distros repositories. Until then, wx2.6 will be used for C::B development.
Of course, patches that allow building with wx2.8 too are fine (assuming they don't break existing functionality).
Be patient!
This bug will be fixed soon...

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #20 on: November 24, 2006, 12:25:09 pm »
... Until then, wx2.6 will be used for C::B development.
Of course, patches that allow building with wx2.8 too are fine ...

That is what we are discussing, yes :-)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #21 on: November 24, 2006, 12:27:32 pm »
FYI:

The only thing that seems to need WXWIN_COMPATIBILITY_2_4 set to 1 is the use of wxHIDE_READONLY. I have submitted a patch to guard all the locations that it is used in.

Isn't it easier to just #define it to 0 for newer wxWidgets, instead of guarding it everywhere ?

Code
#if !WXWIN_COMPATIBILITY_2_4
#define wxHIDE_READONLY 0
#endif
« Last Edit: November 24, 2006, 12:29:06 pm by afb »

sethjackson

  • Guest
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #22 on: November 24, 2006, 01:45:55 pm »
FYI:

The only thing that seems to need WXWIN_COMPATIBILITY_2_4 set to 1 is the use of wxHIDE_READONLY. I have submitted a patch to guard all the locations that it is used in.

Isn't it easier to just #define it to 0 for newer wxWidgets, instead of guarding it everywhere ?

Code
#if !WXWIN_COMPATIBILITY_2_4
#define wxHIDE_READONLY 0
#endif

IIRC we use that flag in the file dialogs somewhere........

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #23 on: November 24, 2006, 04:36:44 pm »
Isn't it easier to just #define it to 0 for newer wxWidgets, instead of guarding it everywhere ?

Code
#if !WXWIN_COMPATIBILITY_2_4
#define wxHIDE_READONLY 0
#endif

Yes, it is much easier, but it seemed to make C::B unstable. I have done some more testing and C::B is unstable when WXWIN_COMPATIBILITY_2_4 is set to 0. Why, I don't know yet. I added guards around the wxHIDE_READONLY so setting it to zero was not the cause. But, setting WXWIN_COMPATIBILITY_2_4 to zero was.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #24 on: November 24, 2006, 06:11:35 pm »
C::B is unstable when WXWIN_COMPATIBILITY_2_4 is set to 0.

The one I set to zero was wxHIDE_READONLY constant, not WXWIN_COMPATIBILITY_2_4...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #25 on: November 24, 2006, 06:31:30 pm »
#if !WXWIN_COMPATIBILITY_2_4
#define wxHIDE_READONLY 0
#endif

This implies that wxHIDE_READONLY is 0 when WXWIN_COMPATIBILITY_2_4 is 0.
And, the code above ONLY makes sense when WXWIN_COMPATIBILITY_2_4 is 0; otherwise the code is not needed. So, are you testing with WXWIN_COMPATIBILITY_2_4 = 1 or = 0?

Tim S
« Last Edit: November 24, 2006, 06:34:54 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #26 on: November 25, 2006, 11:09:01 am »
And, the code above ONLY makes sense when WXWIN_COMPATIBILITY_2_4 is 0; otherwise the code is not needed.

Right, I was only using it in the wxWidgets 2.8 builds. What I meant was that I didn't change the 2.4 compat.

Quote
So, are you testing with WXWIN_COMPATIBILITY_2_4 = 1 or = 0?

On for 2.6, Off for 2.8. This was just discussing your patch, but it's interesting that you mention that using wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 is also unstable (I knew that wxWidgets 2.8 was, but...) Guess I need to build another debugging version of wx26 then, with the 2.4 compat disabled.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #27 on: November 26, 2006, 02:06:01 am »
On for 2.6, Off for 2.8. This was just discussing your patch, but it's interesting that you mention that using wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 is also unstable (I knew that wxWidgets 2.8 was, but...) Guess I need to build another debugging version of wx26 then, with the 2.4 compat disabled.

Yes, wxWidgets 2.8 with WXWIN_COMPATIBILITY_2_4=1, works much better than with WXWIN_COMPATIBILITY_2_4=0.

I am going to work on this issue using wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 in order to remove the whole set of wxWidgets 2.8 changes from the picture.

Do you think I should start a new thread on wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 issues?

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #28 on: November 26, 2006, 10:52:33 am »
I am going to work on this issue using wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 in order to remove the whole set of wxWidgets 2.8 changes from the picture.

Do you think I should start a new thread on wxWidgets 2.6 with WXWIN_COMPATIBILITY_2_4=0 issues?

Sounds like a good plan, and it should probably go in a separate thread.

(Building a wxMac 2.6 with --enable-debug --disable-compat24 now...)
« Last Edit: November 26, 2006, 10:55:15 am by afb »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Patches to compile and link C::B against wxWidgets 2.8.0
« Reply #29 on: November 26, 2006, 05:12:11 pm »
You were right, it seems that the crashes with wxWidgets 2.8.0 are in fact general crashes when compat24 is turned off... I'm seeing the same ones in wxWidgets 2.6.3p2 now, that I did with wxWidgets 2.8.0rc1 earlier:

Settings > Environments *crash*
Code
../src/generic/listctrl.cpp(3699): assert "wxAssertFailure" failed: invalid item index in SetItem
Settings > Editor *crash*
Code
../src/generic/listctrl.cpp(3699): assert "wxAssertFailure" failed: invalid item index in SetItem
Settings > Compiler and Debugger *crash*
Code
../src/common/list.cpp(326): assert "wxAssertFailure" failed: invalid index in wxListBase::Item
Settings > Global variables *crash*
Code
../src/mac/carbon/choice.cpp(217): assert "wxAssertFailure" failed: wxChoice::GetString(): invalid index

So it seems that debugging/fixing Code::Blocks with this compat setting turned off in wxWidgets 2.6 is a good idea to start with, as it is both good now and will also help running with wxWidgets 2.8 later ?