Author Topic: wxSmith tutorial1 fails with a segmentation error  (Read 2681 times)

Offline richrobin

  • Single posting newcomer
  • *
  • Posts: 7
wxSmith tutorial1 fails with a segmentation error
« on: October 10, 2016, 05:30:49 pm »
Being new to Code::Blocks I decided to start with the wxSmith Tutorials. Tutorial 1 is a simple Hello World type of program where you first add a box sizer to the main window, then a panel, add another boxsizer to the panel then place some static text in it. If at that point you compile and run you get a segmentation error. The segmentation error occurs at the call to Setmenubar(MenuBar1). However looking back at the code that wxSmith created there is a statement just prior to calling Layout() that I could not understand the purpose of "SetSizer(BoxSizer2)" which I think sets the sizer for the main window to the sizer for the panel.  I commented out SetSizer(BoxSizer2) and it compiles and runs as expected. The only problem is that when you go on to add the button wxSmith reintroduces this erroneous line of code.

Is this an initiation test ?   I find it difficult to believe that wxSmith wasn't tested against its own tutorials. :o

I am using the current binary windows installer for codeblocks 16.1 with the mingw32 4.9.2 compiler  wxWidgets is version 3.0.2
« Last Edit: October 11, 2016, 12:23:09 pm by richrobin »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxSmith tutorial1 fails with a segmentation error
« Reply #1 on: October 10, 2016, 09:30:44 pm »
The only problem is that when you go on to add the button wxSmith reintroduces this erroneous line of code.

This is auto generated code, so if there is a bug in the generator, every time you chance something the bug will get introduced...
can you post a step by step guide to reproduce? Or a minimal example project?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxSmith tutorial1 fails with a segmentation error
« Reply #2 on: October 10, 2016, 11:58:14 pm »
The only problem is that when you go on to add the button wxSmith reintroduces this erroneous line of code.

This is auto generated code, so if there is a bug in the generator, every time you chance something the bug will get introduced...
can you post a step by step guide to reproduce? Or a minimal example project?

Remember to include the wxWidgets version information.

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