On 7/7/12, Rune K. Svendsen <[email protected]> wrote:
> Hello dear list
>
> I'm trying to build libmicrohttpd using mingw-w64, and it's not going so
> well. I'm met with a warning first:
>
> /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winsock2.h:15:2:
>
> warning: #warning Please include winsock2.h before windows.h [-Wcpp]
>

Exactly as it says:  windows.h includes winsock.h (WinSock 1.x api)
header unless you define WIN32_LEAN_AND_MEAN, therefore you must
include winsock2.h before windows.h because winsock2.h already includes
windows.h by itself.

> followed by errors like:
>
>      ../../src/include/plibc/plibc.h:74:8: error: redefinition of
> 'struct _stat64'
> /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/_mingw_stat64.h:77:10:
>
> note: originally defined here
>      ../../src/include/plibc/plibc.h:357:5: error: conflicting types for
> 'truncate'
> /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/unistd.h:45:5:
>
> note: previous declaration of 'truncate' was here
>      ../../src/include/plibc/plibc.h:465:0: warning: "strcasecmp"
> redefined [enabled by default]
> /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/string.h:106:0:
>
> note: this is the location of the previous definition
>      ../../src/include/plibc/plibc.h:466:0: warning: "strncasecmp"
> redefined [enabled by default]
> /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/string.h:105:0:
>
> note: this is the location of the previous definition

That plib.h is defining some types by itself without knowledge of
whether the system headers are already defining them: it should not
do that.

>
> The following series of commands - to build libmicrohttpd - reproduces
> the bug for me on Ubuntu 12.04 (I've attached this as a bash script also)
>
>     svn --non-interactive --trust-server-cert checkout
> https://gnunet.org/svn/libmicrohttpd
>     cd libmicrohttpd/
>     autoreconf -fi
>     wget
> http://ovh.dl.sourceforge.net/project/plibc/plibc/0.1.5/plibc-0.1.5.zip
>     unzip plibc-0.1.5.zip -d plibc
>     export LIBMICROHHTPD_LDFLAGS="-L$(pwd)/plibc/lib"
>     export LIBMICROHHTPD_FLAGS="-I$(pwd)/plibc/include"
>     wget -m
> ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/ -nd -P
> plibc/include/
>     wget
> ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a
>
> -P plibc/lib/
>     wget
> ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/pthreadGC2.dll
>
> -P plibc/bin/
>     mv plibc/lib/libpthreadGC2.a plibc/lib/libpthread.a
>     CFLAGS="$CFLAGS $LIBMICROHHTPD_FLAGS" CPPFLAGS="$CPPFLAGS
> $LIBMICROHHTPD_FLAGS" LDFLAGS="$LDFLAGS $LIBMICROHHTPD_LDFLAGS"
> ./configure --host=i686-w64-mingw32 --disable-curl --disable-https
>     make
>
> So it seems some things are defined both in mingw64's includes and in
> plibc's includes, but the configure script aborts if I don't have plibc
> installed. Any ideas on how to fix this?
>

It is plibc's fault. Please take it to the plibc developers.

> Thanks! :)
>
> /Rune
>

--
O.S.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to