#15518 closed build error (fixed)

Build broken with ascii --enable-stl --enable-std_string

Reported by: spectrum Owned by:
Priority: high Milestone: 3.0.0
Component: build Version: 2.9.5
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

Dear All,

i am building 2.9.4 or 2.9.5 on Debian, both stable or testing, with:

./configure --disable-unicode --enable-stl --enable-std_string --enable-std_string_conv_in_wxstring

Build is broken:

/src/gtk/utilsgtk.cpp: In function ‘wxCharBuffer wxConvertToGTK(const wxString&, wxFontEncoding)’:
./src/gtk/utilsgtk.cpp:128:34: error: no matching function for call to ‘wxMBConv::cMB2WC(const wxString&)’
./src/gtk/utilsgtk.cpp:128:34: note: candidates are:
In file included from ./include/wx/strvararg.h:21:0,
                 from ./include/wx/string.h:51,
                 from ./include/wx/memory.h:16,
                 from ./include/wx/object.h:20,
                 from ./include/wx/wx.h:16,
                 from ./include/wx/wxprec.h:57:
./include/wx/strconv.h:86:25: note: const wxWCharBuffer wxMBConv::cMB2WC(const char*) const
./include/wx/strconv.h:86:25: note:   no known conversion for argument 1 from ‘const wxString’ to ‘const char*’
./include/wx/strconv.h:105:9: note: const wxWCharBuffer wxMBConv::cMB2WC(const char*, size_t, size_t*) const
./include/wx/strconv.h:105:9: note:   candidate expects 3 arguments, 1 provided
./include/wx/strconv.h:112:25: note: const wxWCharBuffer wxMBConv::cMB2WC(const wxScopedCharBuffer&) const
./include/wx/strconv.h:112:25: note:   no known conversion for argument 1 from ‘const wxString’ to ‘const wxScopedCharBuffer& {aka const wxScopedCharTypeBuffer<char>&}’
make: *** [coredll_gtk_utilsgtk.o] Error 1

I am actually fixing this with:

/src/gtk/utilsgtk.cpp : @ line 128

    .....
    wxWCharBuffer wbuf;
    if ( enc == wxFONTENCODING_SYSTEM || enc == wxFONTENCODING_DEFAULT )
    {
-         wbuf = wxConvUI->cMB2WC(s);
+         wbuf = wxConvUI->cMB2WC(s.c_str());
    }
    .....

Regards,
angelo

Change History (1)

comment:1 Changed 14 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [74838]) Add missing c_str() call to fix wxGTK ANSI+STL build.

Closes #15518.

Note: See TracTickets for help on using tickets.