Cygwin 1.7.1 fails to compile wxWidgets 2.8.10 and 2.9.0

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Radagast
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Dec 25, 2009 8:38 am
Location: Sweden

Cygwin 1.7.1 fails to compile wxWidgets 2.8.10 and 2.9.0

Post by Radagast »

Code: Select all

$ ../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
$ make
/cygdrive/c/wxWidgets-2.8.10/build-debug/bk-deps g++ -c -o baselib_msw_utils.o
-D__WXMSW__            -DwxUSE_GUI=0 -DwxUSE_BASE=1 -D_FILE_OFFSET_BITS=64 -D_LA
RGE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxWidgets-2.8.10/build-debug/lib/wx/includ
e/msw-ansi-debug-static-2.8 -I../include -Wall -Wundef -Wno-ctor-dtor-privacy -g
gdb -O0 ../src/msw/utils.cpp
In file included from ../src/msw/utils.cpp:56:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../include/w32api/winsock.h:479: erro
r: declaration of C function 'int select(int, _types_fd_set*, _types_fd_set*, _t
ypes_fd_set*, const timeval*)' conflicts with
/usr/include/sys/select.h:31: error: previous declaration 'int select(int, _type
s_fd_set*, _types_fd_set*, _types_fd_set*, timeval*)' here
../src/msw/utils.cpp: In function 'const wxChar* wxGetHomeDir(wxString*)':
../src/msw/utils.cpp:407: 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:407: warning: 'int cygwin_conv_to_full_win32_path(const cha
r*, char*)' is deprecated (declared at /usr/include/sys/cygwin.h:52)
make: *** [baselib_msw_utils.o] Error 1

Code: Select all

$ ../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
$ make
/cygdrive/c/wxWidgets-2.9.0/build-debug/bk-deps g++ -c -o baselib_appbase.o  -D_
_WXMSW__     -DWXBUILDING      -I../src/regex  -DwxUSE_GUI=0 -DwxUSE_BASE=1 -Wal
l -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE
_OFFSET_BITS=64 -D__WXDEBUG__ -I/cygdrive/c/wxWidgets-2.9.0/build-debug/lib/wx/i
nclude/msw-unicode-debug-static-2.9 -I../include -ggdb -O0  ../src/common/appbas
e.cpp
In file included from ../include/wx/string.h:52,
                 from ../include/wx/memory.h:16,
                 from ../include/wx/object.h:20,
                 from ../include/wx/list.h:33,
                 from ../src/common/appbase.cpp:31:
../include/wx/wxcrtbase.h: In function 'wchar_t* wxStrdup(const wchar_t*)':
../include/wx/wxcrtbase.h:698: error: '_wcsdup' was not declared in this scope
In file included from ../include/wx/utils.h:21,
                 from ../src/common/appbase.cpp:35:
/usr/include/sys/stat.h: In function 'int wxMkDir(const wxString&, mode_t)':
/usr/include/sys/stat.h:127: error: too few arguments to function 'int mkdir(con
st char*, mode_t)'
../include/wx/filefn.h:506: error: at this point in file
In file included from ../include/wx/evtloop.h:262,
                 from ../src/common/appbase.cpp:42:
../include/wx/unix/evtloop.h: At global scope:
../include/wx/unix/evtloop.h:27: error: redefinition of 'class wxConsoleEventLoo
p'
../include/wx/msw/evtloop.h:101: error: previous definition of 'class wxConsoleE
ventLoop'
make: *** [baselib_appbase.o] Error 1
Cygwin 1.7 contains many fundamental changes compared to older Cygwins, so maybe the failures aren't that surprising. Are any workarounds known?
nmontec
Earned a small fee
Earned a small fee
Posts: 13
Joined: Wed Nov 29, 2006 4:40 pm
Location: Italy
Contact:

Post by nmontec »

I am having the same issue, does anyone know how to solve this?

thanks a lot
Nicola
AUser
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Jun 26, 2006 12:18 am

Post by AUser »

You can --disable-sockets , if your application does not use sockets. Otherwise, this is bug 11626 : http://trac.wxwidgets.org/ticket/11626

this is reported fixed in SVN
kramik
In need of some credit
In need of some credit
Posts: 1
Joined: Mon Dec 06, 2010 8:22 pm

still can't compile in cygwin

Post by kramik »

The issue is still present with 2.9.1 and 2.9.0. Haven't tried any 2.8 with cygwin. It says it was fixed in SVN but I thought that would have been released in 2.9.1.
Jorge Dominguez
In need of some credit
In need of some credit
Posts: 1
Joined: Wed Mar 09, 2011 11:10 am
Location: Santiage de compostela, Spain
Contact:

Post by Jorge Dominguez »

Simply you need to configure gcc prepocessor to use winsock API with -D__USE_W32_SOCKETS define

export CPPFLAGS=-D__USE_W32_SOCKETS;
./configure --prefix=/usr/local --with-msw

I think that problem is on port of cygwin that uses /usr/include/w32api/winsock.h and ovelaps default select function on cygwin include/sys/select.h.

__USE_W32_SOCKETS define says to cygwin compiler to use winsock.h instead of default select.h and uses Windows Sockets like mingw.

Conpiled with:

- wxWidgets-2.8.10
- CYGWIN_NT-5.1 TR374 1.7.8(0.236/5/3) 2011-03-01 09:36 i686 Cygwin
Post Reply