Author Topic: problem of wxWidgets project with converting 2.6 to 2.8  (Read 5214 times)

Offline DreamCT

  • Multiple posting newcomer
  • *
  • Posts: 13
problem of wxWidgets project with converting 2.6 to 2.8
« on: May 15, 2007, 10:01:14 am »
hi all.

I developed a wxWidgets project with wxsmith based on wx2.6 and cb_nightly_rev3796.

But after I update to wx2.8 and cb_rev3960, compile error occured.

Error say that "wxDEFAULT_DIALOG_STYLE undeclared".
That source had no problem before update, and other compile / link condition checked with regard to wx2.8.3.

So I tested to make a simple wxWidgets project.
Main frame was created to dialog_style and add a new wxFrame with same style by wxSmith.

The result is that in case of only main frame exist produced no error, but a added frame generated error same above.

What is wrong and what shall I do?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: problem of wxWidgets project with converting 2.6 to 2.8
« Reply #1 on: May 15, 2007, 12:59:09 pm »
Do you have an include of wx/dialog.h, the header wx/dialog.h defines the value of wxDEFAULT_DIALOG_STYLE.

Note, in 2.8 sometimes you need to include more headers because other headers no longer include them.

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

Offline DreamCT

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: problem of wxWidgets project with converting 2.6 to 2.8
« Reply #2 on: May 15, 2007, 02:56:54 pm »
first, thanks to reply.

But I knew the value is defined in wx/dialog.h.
So my action against error was set macro "WX_PRECOMP" and adapt fitting wxprec.h to source.

Because the wx/dialog.h is inclued by wx/wx.h. and the macro enable includes wx/wx.h.

My point is that I thought this method maybe not FUNDAMENTAL.

Of course this method could fix compile error.(really I did.) but more importantly, run time error occured, more headache.

As I think there is more basic cause, ask your valued advice.

Thanks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: problem of wxWidgets project with converting 2.6 to 2.8
« Reply #3 on: May 15, 2007, 03:23:56 pm »
What is the error?
You have no compile errors, right?
You have no link errors, right?

Did you test the program using wxWidgets 2.6 with 2.4 mode disabled?
See wx/setup.h value of WXWIN_COMPATIBILITY_2_4 is 0 if it is disabled.

Are you testing the program using wxWidgets 2.8 with 2.6 mode enabled?
See wx/setup.h value of WXWIN_COMPATIBILITY_2_6 is 1 if it is enabled.

Did you check all the xrc files for things that need upgraded? (These cause runtime errors)

Know items needing replaced in xrc files with 2.4 mode disabled and 2.6 mode enabled:
  replace wxCheckList with wxCheckListBox
  replace wxTE_LINEWRAP with wxTE_CHARWRAP
  replace wxRESIZE_BOX  with   wxMAXIMIZE_BOX
  replace wxTHICK_FRAME  with   wxRESIZE_BORDER

Tim S



« Last Edit: May 15, 2007, 03:43:32 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org