2 Replies Latest reply on Apr 26, 2018 2:53 PM by Andrew Watkins

    wxWidgets: Should wxSIZE_T_IS_UINT not be defined in setup.h

    Andrew Watkins

      Being building FileZilla on Solaris 11.4  at got some strange errors:


      /usr/include/wx-3.0/wx/filename.h:473:43: error: ambiguous overload for ‘operator[]’ (operand types are ‘wxString’ and ‘unsigned int’)

               { return GetPathSeparators(format)[0u]; }


      /usr/include/wx-3.0/wx/filename.h:473:43: note: candidate: operator[](const char*, long int) <built-in>

      /usr/include/wx-3.0/wx/filename.h:473:43: note: candidate: operator[](const wchar_t*, long int) <built-in>

      In file included from /usr/include/wx-3.0/wx/memory.h:15:0,

                       from /usr/include/wx-3.0/wx/object.h:19,

                       from /usr/include/wx-3.0/wx/event.h:16,

                       from /usr/include/wx-3.0/wx/window.h:18,

                       from /usr/include/wx-3.0/wx/nonownedwnd.h:14,

                       from /usr/include/wx-3.0/wx/toplevel.h:20,

                       from /usr/include/wx-3.0/wx/dialog.h:14,

                       from /usr/include/wx-3.0/wx/msgdlg.h:18,

                       from msgbox.h:4,

                       from filezilla.h:6:

      /usr/include/wx-3.0/wx/string.h:1544:15: note: candidate: wxUniChar wxString::operator[](int) const

           wxUniChar operator[](int n) const



      and then looking at the code of string.h

      #ifndef wxSIZE_T_IS_UINT

          wxUniCharRef operator[](unsigned int n)

            { return at(n); }

      #endif // size_t != unsigned int

      It is using "size_t" and not "unsigned int"


      If I comment out "wxSIZE_T_IS_UINT" from /usr/lib/wx/include/gtk2-unicode-3.0/wx/setup.h them it all works. Well it should not be defined since "size_t" is NOT the same type as unsigned int

      /* Define if size_t on your machine is the same type as unsigned int. */

      /*#define wxSIZE_T_IS_UINT 1*/


      Then the code compiles!