cannot pass objects of non-POD type
Vadim Zeitlin
vadim at wxwidgets.org
Tue Dec 11 13:51:18 PST 2007
On Tue, 11 Dec 2007 22:31:19 +0100 Eirik Nesje <einesje at online.no> wrote:
EN> I have the following statment that works using Visual Studio 7.1 Standard :
It doesn't. It just miraculously appears to.
EN> wxSQL += wxString::Format(wxT("%d"), file.GetSize());
EN>
EN> (wxSQL is a wxString).
EN>
EN> But using MinGW i get this message :
EN>
EN> *** traverseframe.h:80: warning: cannot pass objects of non-POD type
EN> `class wxULongLong' through `...'; call will abort at runtime
The message is exactly correct. You pass wxULongLong where an int is
expected (due to "%d"). Don't do this and better yet don't use Format() at
all unnecessarily: just "wxSQL << file.GetSize()" will suffice.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list