Hi all,

I'm implementing a function (LoadURL) which takes a single argument of const wxString&. wxString is implemented in the main Wx typemap, but not a const version. If I try neglecting the const in my .xs file I'm told:

WebKit.c: In function ‘void XS_Wx__WebView_LoadURL(PerlInterpreter*, CV*)’:
WebKit.c:217: error: conversion from ‘wxString*’ to ‘const wxString’ is ambiguous /usr/local/include/wx-2.8/wx/string.h:692: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/include/wx-2.8/wx/string.h:682: note: wxString::wxString(int) <near match>
WebKit.c: In function ‘void boot_Wx__WebKit(PerlInterpreter*, CV*)’:
WebKit.c:419: warning: deprecated conversion from string constant to ‘char*’

When I try mapping const wxString to T_WXSTRING just like the non-const version (I saw that both T_WXCHAR and T_CONST_WXCHAR have the same inputs and outputs in the typemap) I'm even more erroneous:

WebKit.c: In function ‘void XS_Wx__WebView_LoadURL(PerlInterpreter*, CV*)’:
WebKit.c:215: error: passing ‘const wxString’ as ‘this’ argument of ‘wxString& wxString::operator=(const wxString&)’ discards qualifiers WebKit.c:217: error: conversion from ‘const wxString*’ to ‘const wxString’ is ambiguous /usr/local/include/wx-2.8/wx/string.h:692: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/include/wx-2.8/wx/string.h:682: note: wxString::wxString(int) <near match>
WebKit.c: In function ‘void boot_Wx__WebKit(PerlInterpreter*, CV*)’:
WebKit.c:419: warning: deprecated conversion from string constant to ‘char*’

... Clearly I'm swinging in the dark here <:-) I'm working my way slowly towards understanding everything that's actually going on so I can have a proper go at this.

In the meantime I wondered if there was a reason const wxString hadn't been implemented before?

I grepped and found it in some of the main Wx package .xs files, but always inside a structure like " %name{Wx::TextCtrlBase} class wxTextCtrlBase {... " and I don't recognise that syntax /at all/. The Wx package features strongly when doing a Google Code Search for "%name{". What is it?

Thanks,

-- Ryan

Reply via email to