In the past, I�ve been able to compiling the project stimfit with
mingw-cross-compiler
http://mxe.cc/ using wxwidget 2.8.12. When I tried
to switch to 2.9.4, compiling wxWidget with mingw worked fine, but
compiling stimfit failed with the following error:
./stf.cpp:1:0: warning: -fPIC ignored for target (all code is position
independent) [enabled by default]
In file included from
.../usr/i686-static-mingw32/include/wx-2.9/wx/utils.h:21:0,
from .../usr/i686-static-mingw32/include/wx-2.9/wx/cursor.h:70,
from .../usr/i686-static-mingw32/include/wx-2.9/wx/event.h:22,
from .../usr/i686-static-mingw32/include/wx-2.9/wx/wx.h:25,
from ./stf.h:57,
from ./stf.cpp:24:
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxAccess(const wxString&, mode_t)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:504:46: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _waccess(const wchar_t*, int)'
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxOpen(const wxString&, int, mode_t)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:506:51: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _wopen(const wchar_t*, int, ...)'
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxStat(const wxString&, _stati64*)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:511:43: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _wstati64(const wchar_t*, _stati64*)'
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxLstat(const wxString&, _stati64*)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:513:44: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _wstati64(const wchar_t*, _stati64*)'
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxRmDir(const wxString&)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:515:39: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _wrmdir(const wchar_t*)'
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h: In function 'int
wxMkDir(const wxString&, mode_t)':
.../usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h:519:39: error:
cannot convert 'const wxScopedCharBuffer {aka const
wxScopedCharTypeBuffer<char>}' to 'const wchar_t*' for argument '1' to
'int _wmkdir(const wchar_t*)'
I'm using the unicode version of wx-config; thus wxUSE_UNICODE is set.
After disabling the lines 504 to 519 in filefn.h (see patch below), I
could compile my project in the same way than with wxwidget2.8.
diff -U 5 usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h.orig
usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h
--- usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h.orig 2012-11-14
21:28:03.000000000 +0100
+++ usr/i686-static-mingw32/include/wx-2.9/wx/filefn.h 2012-11-14
21:55:22.000000000 +0100
@@ -498,10 +498,11 @@
#endif
#ifndef wxFtell
#define wxFtell ftell
#endif
+#if !wxUSE_UNICODE
inline int wxAccess(const wxString& path, mode_t mode)
{ return wxCRT_Access(path.fn_str(), mode); }
inline int wxOpen(const wxString& path, int flags, mode_t mode)
{ return wxCRT_Open(path.fn_str(), flags, mode); }
@@ -521,10 +522,12 @@
inline int wxMkDir(const wxString& path, mode_t mode)
{ return wxCRT_MkDir(path.fn_str(), mode); }
#endif
#endif // !__WXWINCE__
+#endif //!wxUSE_UNICODE
+
#ifdef O_BINARY
#define wxO_BINARY O_BINARY
#else
#define wxO_BINARY 0
#endif
This is probably not the best solution, but I want to make you aware of
that issue. Or if I missed something, please let me know.
Alois