Linux : WxWidgets 3.1 migration

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Linux : WxWidgets 3.1 migration

Post by sapthagiri » Mon Mar 06, 2017 10:33 am

Hi team
We are migrating wxWidgets 3.0 to 3.1.

We have configured wxWidgets 3.1 using below option:
./configure --enable-debug --disable-unicode --with-gtk=3.0

Build Environment:
OS : Ubuntu 14.04 LTS 32-bit

Compilation was successful & we integrated the wxWidgets 3.1 (libraries, binaries, header files) into our application.
After building our application we are seeing below compilation errors:

error: ‘wxXmlProperty’ was not declared in this scope
wxXmlProperty *pAttributes = pChild->GetProperties();
^
error: ‘pAttributes’ was not declared in this scope
wxXmlProperty *pAttributes = pChild->GetProperties();
^
error: ‘class wxXmlNode’ has no member named ‘GetProperties’
wxXmlProperty *pAttributes = pChild->GetProperties();
^
wx/include/wx-3.1/wx/xml/xml.h:204:10: error: ‘void wxXmlNode::AddProperty(const wxString&, const wxString&)’ is private
void AddProperty(const wxString& name, const wxString& value);
^
error: within this context
pDataNode->AddProperty(_T("type"), pstCurrent->strType);
^
wx/include/wx-3.1/wx/xml/xml.h:204:10: error: ‘void wxXmlNode::AddProperty(const wxString&, const wxString&)’ is private
void AddProperty(const wxString& name, const wxString& value);
^
error: within this context
pDataNode->AddProperty(_T("value"), pstCurrent->strValue);
^
error: ‘void wxXmlNode::AddProperty(const wxString&, const wxString&)’ is private
void AddProperty(const wxString& name, const wxString& value);
^
pDataNode->AddProperty(_T("mode"), strMode);
^
Please kindly provide your inputs to resolve the error.

Thanks & Regards,
Giri

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Mon Mar 06, 2017 11:28 am

Hi team,

Just to add to the previous mail:

We observed in the error listed previously : class wxXmlNode’ has no member named ‘GetProperties. (Please refer file : wx/xml/xml.h)
Also regarding the 2nd error wxXmlProperty is not declared in this scope, we saw following snippet in wx/xml/xml.h file :

#if WXWIN_COMPATIBILITY_2_8
#define wxXmlProperty wxXmlAttribute
#endif

So please kindly provide what are the replacement functions for deprecated methods & also provide any manual for the changes done in 3.1.

Thanks,
Giri

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2423
Joined: Sun Jan 03, 2010 5:45 pm

Re: Linux : WxWidgets 3.1 migration

Post by PB » Mon Mar 06, 2017 11:52 am

sapthagiri wrote:provide any manual for the changes done in 3.1.
The list of changes is provided in your wxWidgets/docs folder in files changes.txt (changes since 3.0) and changes30.txt (changes since 2.8).

There you can find
wxXmlProperty class was renamed to wxXmlAttribute in order to use standard terminology. Corresponding wxXmlNode methods were renamed to use "Attribute" instead of "Property" or "Prop" in their names.
Obviously, the compatibility defines do affect how some things behave regarding deprecated code.

DavidHart
Site Admin
Site Admin
Posts: 3980
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Linux : WxWidgets 3.1 migration

Post by DavidHart » Mon Mar 06, 2017 12:04 pm

Hi,
We have configured wxWidgets 3.1 using below option:
./configure --enable-debug --disable-unicode --with-gtk=3.0
Why disable unicode? Unicode builds are the norm for wx3* so, as well as missing the unicode advantages, you'll get worse support for non-unicode builds as few others will use them and they'll receive less testing.
& also provide any manual for the changes done in 3.1.
In addition to PB's links, the main changes between versions are here; the full changelog here.

Regards,

David

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 364
Joined: Fri Nov 03, 2006 2:00 pm

Re: Linux : WxWidgets 3.1 migration

Post by stahta01 » Tue Mar 07, 2017 2:34 pm

sapthagiri wrote:Hi team
We are migrating wxWidgets 3.0 to 3.1.

We have configured wxWidgets 3.1 using below option:
./configure --enable-debug --disable-unicode --with-gtk=3.0

Build Environment:
OS : Ubuntu 14.04 LTS 32-bit

Please kindly provide your inputs to resolve the error.

Thanks & Regards,
Giri
You do understand that wxWidgets/wxGTK 3.1 is a development version?

Tim S.

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Wed Mar 08, 2017 7:05 am

Hi Team,
Thanks for your inputs.

We have removed the compile time flags as suggested by you.
In our application, we have started using wxXmlAttribute instead of wxXmlProperty. Also we have replaced GetProperties() method with GetAttributes().

Currently we are resolving compilation issues after migrating 3,1 changes to our application.

Thanks,
Giri

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Thu Mar 09, 2017 9:50 am

Hi team,
We were able to resolve compilation issues after migration to wxWidgets 3.1 in our application.

Now after launching our application we are facing below issue:

"Fatal Error: Mismatch between the program and library build versions detected.
The library used 3.1.0 (ANSI,compiler with C++ ABI 1002,wx containers,compatible with 3.0),
and your program used 3.1.0 (ANSI,compiler with C++ ABI 1002,wx containers).
Abort (core dumped)"

I am struck here, not going forward.
Your inputs will be highly appreciated

Thanks & Regards,
Giri

User avatar
doublemax
Moderator
Moderator
Posts: 14875
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linux : WxWidgets 3.1 migration

Post by doublemax » Thu Mar 09, 2017 10:02 am

"Fatal Error: Mismatch between the program and library build versions detected.
The library used 3.1.0 (ANSI,compiler with C++ ABI 1002,wx containers, compatible with 3.0),
and your program used 3.1.0 (ANSI,compiler with C++ ABI 1002,wx containers).
The error is pretty clear, isn't it? You built the library with different settings that your program OR you're including the header files from the wrong version.

BTW: Please don't crosspost on the forum and the mailing list.
Use the source, Luke!

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Thu Mar 09, 2017 10:26 am

Hi team,
Just to add to the above mail,

we ran below commands:
>. wx-config --libs

-L/home/giri/Desktop/sample_application/app/build/../../sample_application/tools/linux/wx/lib -pthread -lwx_gtk2_xrc-3.1 -lwx_gtk2_html-3.1 -lwx_gtk2_qa-3.1 -lwx_gtk2_adv-3.1 -lwx_gtk2_core-3.1 -lwx_base_xml-3.1 -lwx_base_net-3.1 -lwx_base-3.1


>. wx-config --cppflags --release
3.1
-I/home/giri/Desktop/sample_application/app/build/../../sample_application/tools/linux/wx/lib/wx/include/gtk2-ansi-3.1 -I/home/giri/Desktop/sample_application/app/build/../../sample_application/tools/linux/wx/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__

Thanks,
Giri

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4152
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux : WxWidgets 3.1 migration

Post by ONEEYEMAN » Thu Mar 09, 2017 4:13 pm

Just to add something to this thread:
Don't use "--cppflags" - use "--cxxflags" instead.

Thank you.

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Mon Mar 13, 2017 5:45 am

Hi,
Thanks for your inputs.

After building both wxWidgets 3.1 as well the application on the same machine with following configurations:
Machine: Ubuntu 14.04 LTS OS type : 32-bit
GCC : 4.8.4

We are facing below Assert issue after launching the application:

../src/common/sizer.cpp(209): assert "((m_flag) & (wxALIGN_CENTRE_VERTICAL | wxALIGN_BOTTOM)) != (wxALIGN_CENTRE_VERTICAL | wxALIGN_BOTTOM)" failed in wxSizerItem(): wxALIGN_CENTRE_VERTICAL and wxALIGN_BOTTOM can't be used together
Trace/BPT trap (core dumped)


In our application which flags should we maintain ( ALIGN_CENTRE_VERTICAL or ALIGN BOTTOM). why this condition was introduced for wx3.1 onwards.

Kindly provide your inputs, since I am newbie to wxWidgets.

Thanks & Regards,
Giri

User avatar
doublemax
Moderator
Moderator
Posts: 14875
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linux : WxWidgets 3.1 migration

Post by doublemax » Mon Mar 13, 2017 6:39 am

In our application which flags should we maintain ( ALIGN_CENTRE_VERTICAL or ALIGN BOTTOM). why this condition was introduced for wx3.1 onwards.
You can either align an item vertically centered or at the bottom, you have to decide what you want.

wx2.8 silently ignored inconsistent ( = wrong ) sizer flag combinations, 3.0 warns you that something is wrong, so you can fix it.
Use the source, Luke!

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Mon Mar 13, 2017 10:14 am

Hi team,

Thanks for your response.

OS details : Linux Ubuntu 14.04 LTS 32-bit type.

As per your inputs we should not use both ALIGN_CENTRE_VERTICAL or ALIGN BOTTOM flags at a time in our application.
1. Why this check was introduced in source file wxWidgets-3.1.0/src/common/sizer.cpp for wxWidgets 3.1.
Is there any workaround that can be done to resolved apart from the application side.

2. Also facing the below assert after launching application:
./src/gtk/window.cpp(3251): assert ""source"" failed in DoClientToScreen(): ClientToScreen failed on unrealized window
../src/gtk/window.cpp(3321): assert ""source"" failed in DoScreenToClient(): ScreenToClient failed on unrealized window

Kindly provide your inputs.

Please find the backtrace file 'App_backtrace_for_forum.txt" attached for reference after launching my application.

Backtraces:

ASSERT INFO:
../src/gtk/window.cpp(3251): assert ""source"" failed in DoClientToScreen(): ClientToScreen failed on unrealized window

BACKTRACE:

[1] wxWindow::DoClientToScreen(int*, int*) const
[2] wxTopLevelWindowBase::DoClientToScreen(int*, int*) const
[3] wxWindow::DoClientToScreen(int*, int*) const
[4] wxWindow::DoClientToScreen(int*, int*) const
[5] wxWindow::DoClientToScreen(int*, int*) const
[6] wxWindow::DoClientToScreen(int*, int*) const
[7] wxWindow::DoClientToScreen(int*, int*) const
[8] wxWindowBase::DoGetScreenPosition(int*, int*) const
[9] wxScrollHelperBase::HandleOnChildFocus(wxChildFocusEvent&)
[10] wxScrollHelperEvtHandler::ProcessEvent(wxEvent&)
[11] wxWindowBase::TryAfter(wxEvent&)
[12] wxEvtHandler::TryAfter(wxEvent&)
[13] wxEvtHandler::ProcessEvent(wxEvent&)
[14] wxWindowBase::TryAfter(wxEvent&)
[15] wxEvtHandler::ProcessEvent(wxEvent&)
[16] wxScrollHelperEvtHandler::ProcessEvent(wxEvent&)
[17] wxAuiNotebook::SetSelectionToWindow(wxWindow*)
[18] wxAuiNotebook::InsertPage(unsigned int, wxWindow*, wxString const&, bool, wxBitmap const&)
[19] wxAuiNotebook::AddPage(wxWindow*, wxString const&, bool, wxBitmap const&)
[20] AppGUI::AppGUI(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long) /home/Desktop/Mar10_Rebuild_MyApp/app/engine/../src/AppGUI.cpp:522
[21] MyApp::MyApp(wxWindow*, bool) /home/Desktop/Mar10_Rebuild_MyApp/app/engine/../src/mMgr.cpp:333
[22] mFrameApp::OnInit() /home/Desktop/Mar10_Rebuild_MyApp/app/engine/../src/FApp.cpp:176
[23] wxAppConsoleBase::CallOnInit() /home/Desktop/Mar10_Rebuild_MyApp/app/build/../../app/tools/linux/wx/include/wx-3.1/wx/app.h:93
[24] wxEntry(int&, char**)
[25] main /home/Desktop/Mar10_Rebuild_MyApp/app/engine/../src/FApp.cpp:14
[26] __libc_start_main
[27] _start

Thanks & Regards,
Giri

User avatar
doublemax
Moderator
Moderator
Posts: 14875
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linux : WxWidgets 3.1 migration

Post by doublemax » Mon Mar 13, 2017 11:19 am

As per your inputs we should not use both ALIGN_CENTRE_VERTICAL or ALIGN BOTTOM flags at a time in our application.
1. Why this check was introduced in source file wxWidgets-3.1.0/src/common/sizer.cpp for wxWidgets 3.1.
Is there any workaround that can be done to resolved apart from the application side.
I already answered that. The only solution is to remove one of the two flags.

I can't say anything about the other assert.
Use the source, Luke!

sapthagiri
Earned a small fee
Earned a small fee
Posts: 23
Joined: Mon Jan 09, 2017 12:36 pm

Re: Linux : WxWidgets 3.1 migration

Post by sapthagiri » Tue Mar 14, 2017 12:12 pm

Hi Team,
Thanks for your response.

Machine details:
Ubuntu 14.04 LTS OS 32-bit type.

After migrating wxWidgets 3.1 changes to our application, we are facing the following issues:

1. After launching application, observed below assert:
./src/gtk/window.cpp(3251): assert ""source"" failed in
DoClientToScreen(): ClientToScreen failed on unrealized window

Please provide pointers why we are facing this issue, how to debug further?

2. While building wxWidgets 3.1, ran ./configure with the below option:
--with-gtk=3.0

After successful wxWidgets 3.1 compilation, ran the below wx-config commands on the terminal:

> wx-config --cxxflags --release
3.1
-I/home/Desktop/Mar10_Rebuild_App_3.1/App/build/../../App/tools/linux/wx/lib/wx/include/gtk2-ansi-3.1
-I/home/Desktop/Mar10_Rebuild_App_3.1/App/build/../../App/tools/linux/wx/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread

> wx-config --libs
-L/home/Desktop/Mar10_Rebuild_App_3.1/App/build/../../App/tools/linux/wx/lib -pthread -lwx_gtk2_xrc-3.1 -lwx_gtk2_html-3.1 -lwx_gtk2_qa-3.1 -lwx_gtk2_adv-3.1 -lwx_gtk2_core-3.1 -lwx_base_xml-3.1 -lwx_base_net-3.1 -lwx_base-3.1

Since we configured gtk with 3.0 version but in the above commands output we can see wx still pointing to gtk2.

Please provide your inputs.

Thanks & Regards,
Giri

Post Reply