Error building on cywin:./src/msw/utils.cpp: In function ‘const wxChar* wxGetHomeDir(wxString*)’:./src/msw/utils.cpp:391: error: cannot convert ‘const char*’ to ‘const

Hi All:

When i install wxPython on cygwin in windows xp, i get this error and
can't continue...

my enviroment:

$ cygcheck -c cygwin
Cygwin Package Information
Package Version Status
cygwin 1.7.5-1 Incomplete

wxPython-src-2.8.11.0

Following the build instructions on www.wxpython.org, before the
installing of wxPython i have installed additional packages as :
autoconf
automake
gcc-core
gcc-g++
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
make
mingw-runtime
mingw-zlib
patch
w32api // i can't find this package when i am installing cygwin, so
it was not be installed

Then: i put the sourcecode to /usr/sr/wxPython-src-2.8.11.0

$cd /usr/sr/wxPython-src-2.8.11.0
$CC="gcc -mno-cygwin -mwindows" \
CXX="g++ -mno-cygwin -mwindows" \
LDFLAGS="-mno-cygwin -mwindows" \
./configure \
    --with-msw \
    --build=i686-pc-mingw32 \
    --prefix=/opt/wx/2.8 \
    --enable-unicode \
    --enable-debug \
    --enable-debug_gdb \
    --enable-geometry \
    --enable-display \
    --enable-shared \
--enable-optimise \
    --with-expat=builtin \
    --with-regex=builtin \
    --with-zlib=builtin

$make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/stc $*

and then :
./src/msw/utils.cpp: In function ‘const wxChar*
wxGetHomeDir(wxString*)’:
./src/msw/utils.cpp:392: error: cannot convert ‘const char*’ to ‘const
wxChar
*’ for argument ‘1’ to ‘wxChar* wxGetenv(const wxChar*)’
./src/msw/utils.cpp:408: warning: ‘int
cygwin_conv_to_full_win32_path(const cha
r*, char*)’ is deprecated (declared at /usr/include/sys/cygwin.h:52)
./src/msw/utils.cpp:408: error: cannot convert ‘wxString’ to ‘const
char*’ f
or argument ‘1’ to ‘int cygwin_conv_to_full_win32_path(const char*,
char*)’
./src/msw/utils.cpp: In function ‘wxChar* wxGetUserHome(const
wxString&)’:
./src/msw/utils.cpp:472: error: new declaration ‘wxChar*
wxGetUserHome(const wx
String&)’
./include/wx/utils.h:528: error: ambiguates old declaration ‘const
wxWCharBuffe
r wxGetUserHome(const wxString&)’
make: *** [basedll_msw_utils.o] Error 1

please help!

regards.

is anyone can help me?

···

On Jun 1, 11:34 am, xqiang <huangqiang.z...@gmail.com> wrote:

Hi All:

When i install wxPython on cygwin in windows xp, i get this error and
can't continue...

my enviroment:

$ cygcheck -c cygwin
Cygwin Package Information
Package Version Status
cygwin 1.7.5-1 Incomplete

wxPython-src-2.8.11.0

Following the build instructions onwww.wxpython.org, before the
installing of wxPython i have installed additional packages as :
autoconf
automake
gcc-core
gcc-g++
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
make
mingw-runtime
mingw-zlib
patch
w32api // i can't find this package when i am installing cygwin, so
it was not be installed

Then: i put the sourcecode to /usr/sr/wxPython-src-2.8.11.0

$cd /usr/sr/wxPython-src-2.8.11.0
$CC="gcc -mno-cygwin -mwindows" \
CXX="g++ -mno-cygwin -mwindows" \
LDFLAGS="-mno-cygwin -mwindows" \
./configure \
--with-msw \
--build=i686-pc-mingw32 \
--prefix=/opt/wx/2.8 \
--enable-unicode \
--enable-debug \
--enable-debug_gdb \
--enable-geometry \
--enable-display \
--enable-shared \
--enable-optimise \
--with-expat=builtin \
--with-regex=builtin \
--with-zlib=builtin

$make $* \
&& make -C contrib/src/gizmos $* \
&& make -C contrib/src/stc $*

and then :
./src/msw/utils.cpp: In function ‘const wxChar*
wxGetHomeDir(wxString*)’:
./src/msw/utils.cpp:392: error: cannot convert ‘const char*’ to ‘const
wxChar
*’ for argument ‘1’ to ‘wxChar* wxGetenv(const wxChar*)’
./src/msw/utils.cpp:408: warning: ‘int
cygwin_conv_to_full_win32_path(const cha
r*, char*)’ is deprecated (declared at /usr/include/sys/cygwin.h:52)
./src/msw/utils.cpp:408: error: cannot convert ‘wxString’ to ‘const
char*’ f
or argument ‘1’ to ‘int cygwin_conv_to_full_win32_path(const char*,
char*)’
./src/msw/utils.cpp: In function ‘wxChar* wxGetUserHome(const
wxString&)’:
./src/msw/utils.cpp:472: error: new declaration ‘wxChar*
wxGetUserHome(const wx
String&)’
./include/wx/utils.h:528: error: ambiguates old declaration ‘const
wxWCharBuffe
r wxGetUserHome(const wxString&)’
make: *** [basedll_msw_utils.o] Error 1

please help!

regards.

Sorry. I don't build with cygwin and the info we already have about doing the build was contributed by someone else. The wxWidgets portion is tested fairly regularly so it is a bit surprising that the build is failing there for you. You may want to check in the wx-users list to see if anybody can help you get past that error. (All I can guess is that it's a problem with the unicode options, which should work, so perhaps you need to update your compiler or mingw32 headers...)

···

On 6/3/10 6:39 PM, xqiang wrote:

is anyone can help me?

--
Robin Dunn
Software Craftsman