Little Confusion with #include <wx/msgdlg.h>

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.
Post Reply
Mungo1981
Experienced Solver
Experienced Solver
Posts: 86
Joined: Wed Jan 30, 2019 5:42 pm

Little Confusion with #include <wx/msgdlg.h>

Post by Mungo1981 »

Dear Community,
I have some trouble with a little include declaration:

Code: Select all

#include <wx/msgdlg.h>
It will ever try more Errors than I can write here down
So I think can it be that there is a little differences of
the last Versions of wxWidgets.
Or has anybody else some Ideas I doing wrong.

In hope of any help
Mungo1981
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Little Confusion with #include <wx/msgdlg.h>

Post by ONEEYEMAN »

Hi,
What is the problem?
Do you have a compiler issue?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Little Confusion with #include <wx/msgdlg.h>

Post by doublemax »

Did you include "wx/wx.h" first?
Use the source, Luke!
Mungo1981
Experienced Solver
Experienced Solver
Posts: 86
Joined: Wed Jan 30, 2019 5:42 pm

Re: Little Confusion with #include <wx/msgdlg.h>

Post by Mungo1981 »

Thank for try to help me :D

Thank to yours.
1.) I have now #include <wx.wwh>
2.) By the way I have fixed a missing ;

But:
The Problem are still there.

So I will give to yours the first Part of my Error-Message:

Code: Select all

In file included from /usr/include/wx-3.0/wx/strconv.h:17:0,
                 from /usr/include/wx-3.0/wx/strvararg.h:20,
                 from /usr/include/wx-3.0/wx/string.h:46,
                 from /usr/include/wx-3.0/wx/memory.h:15,
                 from /usr/include/wx-3.0/wx/object.h:19,
                 from /usr/include/wx-3.0/wx/wx.h:15,
                 from Data.cpp:5:
/usr/include/wx-3.0/wx/buffer.h:166:23: error: expected ‘)’ before ‘*’ token
         Data(CharType *str, size_t len, Kind kind = Owned)
                       ^
/usr/include/wx-3.0/wx/buffer.h:164:17: error: an anonymous struct cannot have function members
     struct Data : public wxPrivate::UntypedBufferData
                 ^
/usr/include/wx-3.0/wx/buffer.h:180:30: error: ISO C++ forbids declaration of ‘GetNullData’ with no type [-fpermissive]
     static Data *GetNullData()
                              ^
/usr/include/wx-3.0/wx/buffer.h:238:11: error: ISO C++ forbids declaration of ‘m_data’ with no type [-fpermissive]
     Data *m_data;
           ^~~~~~
/usr/include/wx-3.0/wx/buffer.h: In static member function ‘static const wxScopedCharTypeBuffer<T> wxScopedCharTypeBuffer<T>::CreateNonOwned(const CharType*, size_t)’:
/usr/include/wx-3.0/wx/buffer.h:88:74: error: ‘::NonOwned’ has not been declared
             buf.m_data = new Data(const_cast<CharType*>(str), len, Data::NonOwned);
                                                                          ^~~~~~~~
/usr/include/wx-3.0/wx/buffer.h:88:83: error: expected type-specifier before ‘;’ token
             buf.m_data = new Data(const_cast<CharType*>(str), len, Data::NonOwned);
                                                                                   ^
/usr/include/wx-3.0/wx/buffer.h: In static member function ‘static const wxScopedCharTypeBuffer<T> wxScopedCharTypeBuffer<T>::CreateOwned(wxScopedCharTypeBuffer<T>::CharType*, size_t)’:
/usr/include/wx-3.0/wx/buffer.h:103:44: error: expected type-specifier before ‘;’ token
             buf.m_data = new Data(str, len);
So I will hope it's a way to understand me better
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Little Confusion with #include <wx/msgdlg.h>

Post by doublemax »

<wx/msgdlg.h> is used in several of the wxWidgets samples, e.g. the "menu" sample. Can you build that?

Do you include any non-wxWidgets headers before the wxWidgets header? If yes, try moving the down so that they are included after the wx headers.
Use the source, Luke!
Mungo1981
Experienced Solver
Experienced Solver
Posts: 86
Joined: Wed Jan 30, 2019 5:42 pm

Re: Little Confusion with #include <wx/msgdlg.h>

Post by Mungo1981 »

Ok,
I have try so me said,
But it will still not run correctly.
So I have trying the same on another Laptop.
So there it will run already correctly.
I think I have done some incorrectly by my trying to install wxWidgets.
So I have tryed to install by the Software-Center on Linux Ubuntu Mint.
There are the Example Files not installed.

So I will work on the other Machine.
With is for me more complicated.
And try to install wxWidgets when I have more time to do it saftly.

In thanks
Mungo1981
Post Reply