Discussion:
wx-2.9.5 problem
Igor Korot
2014-05-09 06:21:44 UTC
Permalink
Hi, ALL,
I successfully built wxWidgets-2.9.5 with following configuration:

../configure --enable-stl --enable-std_containers
--enable-std_string_conv_in_wxstring

My system is Gentoo Linux and I just upgraded my compiler to 4.7:

***@IgorReinCloud ~/elance5/BaseballDraft/build $ gcc --version
gcc (Gentoo 4.7.3-r1 p1.4, pie-0.5.5) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Now trying to compile my own code I'm getting errors:

error: cannot convert 'const wxString' to 'const char*' for argument '1'

On Windows and Mac/Cocoa with 10.6 as minimum everything built fine.

What am I missing?

Thank you.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-05-09 11:04:28 UTC
Permalink
On Thu, 8 May 2014 23:21:44 -0700 Igor Korot wrote:

IK> I successfully built wxWidgets-2.9.5 with following configuration:
IK>
IK> ../configure --enable-stl --enable-std_containers
IK> --enable-std_string_conv_in_wxstring
...
IK> Now trying to compile my own code I'm getting errors:
IK>
IK> error: cannot convert 'const wxString' to 'const char*' for argument '1'
IK>
IK> On Windows and Mac/Cocoa with 10.6 as minimum everything built fine.
IK>
IK> What am I missing?

That --enable-stl (your other configure options are redundant with it BTW)
disables implicit conversions of wxString to const char* or wchar_t* as it
enables implicit conversions to std::[w]string and you can't have both.

So you need to be explicit about your conversions if you want your code to
compile with this build.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Igor Korot
2014-05-09 14:24:58 UTC
Permalink
Vadim,
Post by Vadim Zeitlin
IK>
IK> ../configure --enable-stl --enable-std_containers
IK> --enable-std_string_conv_in_wxstring
...
IK>
IK> error: cannot convert 'const wxString' to 'const char*' for argument '1'
IK>
IK> On Windows and Mac/Cocoa with 10.6 as minimum everything built fine.
IK>
IK> What am I missing?
That --enable-stl (your other configure options are redundant with it BTW)
disables implicit conversions of wxString to const char* or wchar_t* as it
enables implicit conversions to std::[w]string and you can't have both.
So what is the purpose of this option?
Backward compatibility?
Post by Vadim Zeitlin
So you need to be explicit about your conversions if you want your code to
compile with this build.
So if I build without it everything will compile?

Thank you.
Post by Vadim Zeitlin
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Continue reading on narkive:
Loading...