Don't understand warning

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Don't understand warning

Postby Tony0945 » Tue Oct 09, 2018 5:40 pm

Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.

/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;

Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.

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

Re: Don't understand warning

Postby DavidHart » Tue Oct 09, 2018 6:24 pm

Hi,

You can probably turn off those warning with something from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html. But wxX11 is undermaintained and little-used, and so is far from bug-free. If at all possible I suggest using wxGTK instead.

If for some reason you really can't, I'm afraid that you have to expect issues.

Regards,

David

Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Re: Don't understand warning

Postby Tony0945 » Tue Oct 09, 2018 6:34 pm

I'll try -Wno-attributes.

The problem with wxGTK is that it behaves differently from wxMSW. I want the same behavior and look on both platforms. I don't really care if my application looks and behaves like other gtk applications, I want it to be the same on all platforms.

In regard to your warning, I first built wxwidgets-3.1.1 but, as you say, it is missing a lot.

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

Re: Don't understand warning

Postby ONEEYEMAN » Tue Oct 09, 2018 8:49 pm

Hi,
1. What differences did you encounter? Just name a few.
Is the sample(s) behave the same or different?
How can we see that?
What Windows version did you try the samples on? Which exact GTK+ one?

2. As you already found wxX11 is seriously un-maintained.
If you want to use it - you are on your own.

Now while Vadim and all other core-devs won't mind patches to wxX11 port they won't spend time on it.
That port was made as a placeholder for a possibility to a new (future) port of wxWidgets - think about it as wxUniversal on *nix.

On top of that with X server going away and being replaced with Wayland the port will become obsolete pretty soon.

Thank you.

Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Re: Don't understand warning

Postby Tony0945 » Tue Oct 09, 2018 9:49 pm

Hi. One difference was that on wxGTK you can't override erasing the background for transparency, gtk will always erase it.

IIRC with the file dialog there was a problem when expanding and another when selecting. Doublemax suggested using the universal file dialog and that worked. I've been looking for a link but whenever I add the word "universal", google gives me a ton of links to Universal Studios.

More than that I am disenchanted generally with gtk and RedHat's opaque interfaces. I considered switching to qt but after years of working with wxwidgets it would be a steep re-learning curve.

Are you the ONEYEMAN from Gentoo?

P.S. Yes adding -Wno-attributes to CXXFLAGS makes the warning go away.

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

Re: Don't understand warning

Postby ONEEYEMAN » Tue Oct 09, 2018 9:59 pm

Hi,
Yes, I am. "One" and only. ;-)
In terms of erasing background - did you try to catch the EVT_ERASEBACKGROUND?

About the file dialog - I was looking at that discussion with doublemax, but didn't want to interfere. What was the problem? Can you dig it up?

My suggestion - don't go to Qt.
They are too far from C++ standards and still encourage people to use their container classes.

BTW, do you know that there is a very childish port of wxQt? It is absolutely not ready for production yet, but it starts getting patches on github and hopefully will become a full blown port soon.

I just don't know whether its worth it considering that Qt itself is not C++ standard-complaint... ;-)

Thank you.

P.S.: I'm interested in wxQt, because my current company re-wrote a huge product that was written with wx in Qt (because users wanted a cute interface).
Ugly decision, but now it just would be interesting if everything can be ported in wxQt.

Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Re: Don't understand warning

Postby Tony0945 » Tue Oct 09, 2018 11:38 pm

Found that link: viewtopic.php?f=1&t=44230

Re EVT_ERASEBACKGROUND, apparently not, at least in this incarnation

Code: Select all

tony@MSI src $ grep EVT_ERASEBACKGROUND *.cpp
tony@MSI src $
I do have:

Code: Select all

wxEVT_ERASE_BACKGROUND


The code here http://dpaste.com/3XASJTT is a workaround that works if the parent has a plain colored background.
Now I want to have it work for a background that is a bitmap, too.
The header file is: http://dpaste.com/0M4MVXA

If I can kludge around this, I'll abandon wxX11 for another day (famous last words).

The application is a desktop like i3, Mate, XP, but without Mate's binary data and need for dbus. All configuration data in plain text ala the old .ini files (and i3).

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 234
Joined: Fri Nov 03, 2006 2:00 pm

Re: Don't understand warning

Postby stahta01 » Sat Oct 13, 2018 5:39 am

Tony0945 wrote:Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.

/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;

Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.


If I remember, I will see if I can find the simple and correct fix for this when I have time.

Tim S.

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 234
Joined: Fri Nov 03, 2006 2:00 pm

Re: Don't understand warning

Postby stahta01 » Sat Oct 13, 2018 4:48 pm

stahta01 wrote:
Tony0945 wrote:Linux wxwidgets 3.0.4 compiled without gtk and with universal and X11
gcc 7.3.0

My application compiles but the screen is full of these messages while compiling. They don't occur when wxwidgets is compiled with gtk.

/usr/include/wx-3.0-X11/wx/univ/window.h:18:28: warning: attribute ignored in declaration of 'class wxControlRenderer' [-Wattributes]
class WXDLLIMPEXP_FWD_CORE wxControlRenderer;

Googling about it seems that there are harmless but annoying. Is there a compiler option to stop this? I thought of patching WXDLLIMPEXP_FWD_CORE out but it seemed risky. I've got to say that everytime I look at the source code I feel like I'm descending into macro hell.


If I remember, I will see if I can find the simple and correct fix for this when I have time.

Tim S.


A possible workaround is including "wx/defs.h" before including the wx headers that have the problem.

Tim S.

Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Re: Don't understand warning

Postby Tony0945 » Sat Oct 13, 2018 9:54 pm

Sorry, that didn't make any difference

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 234
Joined: Fri Nov 03, 2006 2:00 pm

Re: Don't understand warning

Postby stahta01 » Sat Oct 20, 2018 12:13 pm

Tony0945 wrote:I'll try -Wno-attributes.

The problem with wxGTK is that it behaves differently from wxMSW. I want the same behavior and look on both platforms. I don't really care if my application looks and behaves like other gtk applications, I want it to be the same on all platforms.

In regard to your warning, I first built wxwidgets-3.1.1 but, as you say, it is missing a lot.


I would try using wxGTK on Windows and see how it works and looks for you.

Since your post, I have gotten wxGTK/Univ to build on Linux and Windows and you might try that if plain wxGTK is not good enough.

The fixes are only to wxWidgets git master branch.

Tim S.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 4 guests