I've tried the following:
./configure --with-contrib-plugins=wxsmith
make
And I get the following error while compiling:
./wxscoder.cpp: In member function 'bool wxsCoder::ApplyChangesEditor(cbEditor*, const wxString&, const wxString&, wxString&, bool, bool, wxString&)':
./wxscoder.cpp:378: error: no matching function for call to 'wxsCoder::RebuildCode(wxString&, const wxChar*, int, wxString&)'
./wxscoder.h:151: note: candidates are: wxString wxsCoder::RebuildCode(wxString&, const wchar_t*, int, wxString&)
./wxscoder.cpp: In member function 'bool wxsCoder::ApplyChangesString(wxString&, const wxString&, const wxString&, wxString&, bool, bool, bool&, wxString&)':
./wxscoder.cpp:466: error: no matching function for call to 'wxsCoder::RebuildCode(wxString&, const wxChar*, size_t, wxString&)'
./wxscoder.h:151: note: candidates are: wxString wxsCoder::RebuildCode(wxString&, const wchar_t*, int, wxString&)
Anybody encounter this before?
Anybody encounter this before?
No, not seen it when using 2.8 wxWidgets; what version of wxWidgets are you using?
2.8.???.???
Have seen similar problem when using 2.9/trunk wxWidgets; the type of patch I am using shown below.
I change .c_str() to .wx_str() but an wxWidgets expert said it is not a solid fix for all wxWidgets builds, works for me under Windows XP.
Index: src/plugins/contrib/wxSmith/wxscoder.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxscoder.cpp (revision 5297)
+++ src/plugins/contrib/wxSmith/wxscoder.cpp (working copy)
@@ -383,7 +383,7 @@
( ch == _T('\t') ) ? _T('\t') : _T(' '));
}
- Code = RebuildCode(BaseIndentation,Code.c_str(),(int)Code.Length(),EOL);
+ Code = RebuildCode(BaseIndentation,Code.wx_str(),(int)Code.Length(),EOL);
// Fixing up positions to contain or not header / ending sequence
if ( !CodeHasHeader ) Position += Header.Length();
@@ -478,7 +478,7 @@
( ch == _T('\t') ) ? _T('\t') : _T(' '));
}
- Code = RebuildCode(BaseIndentation,Code.c_str(),Code.Length(),EOL);
+ Code = RebuildCode(BaseIndentation,Code.wx_str(),Code.Length(),EOL);
// Checking if code has really changed
if ( Content.Mid(0,EndPosition) == Code )
I have the same error (with wxwidget 2.8.9 on X64)
I've changed the lines :
Code = RebuildCode(BaseIndentation,Code.c_str(),(int)Code.Length(),EOL);
by
Code = RebuildCode(BaseIndentation,(wchar_t*)Code.c_str(),(int)Code.Length(),EOL);
and it works for me
I don't understand the problem since wxString::c_str produces const wxChar* (http://docs.wxwidgets.org/stable/wx_wxstring.html#wxstringcstr) and the function RebuildCode takes const wxChar* as an argument.
It looks like wxWidgets switches between ANSI / UNICODE modes (????)
And neither the wxString::wx_str() nor the wchar_t* cast is good solution. The first one does not exist in wx 2.8 series, the second is a bad workaround and in worst cases may lead to erasing wxSmith-generated code.
BTW. I don't have any problems on Ubuntu x64, wx 2.8.8
FYI: IIRC wxString::wx_str() existed in 2.6 wxWidgets, it just was not documented any where I could find.
From 2.6.4 string.h
// identical to c_str(), for wxWin 1.6x compatibility
const wxChar* wx_str() const { return c_str(); }
Tim S