Did you also change the files in the /cbits/ folder? Because they also check for HAVE_WINSOCK_H.<br><br><div class="gmail_quote">2012/2/7 Alberto G. Corona <span dir="ltr"><<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The code is evolving and none of the versions match exactily with the<br>
patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files<br>
solves the compilation problem at least in the network 2.3.0.10<br>
version from hackage.<br>
<br>
However it produces the same undefined references when this library is<br>
imported in my application. It seems that some object code is not<br>
included in the final library. I verified that at least some of these<br>
undefined references correspond with C code in the source, but<br>
somehow this is not included in the object library....<br>
<br>
2012/2/7 Johan Tibell <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Note that there are two branches on github, master and stable. You want the<br>
> latter.<br>
><br>
> On Feb 7, 2012 8:23 AM, "Alberto G. Corona" <<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>> wrote:<br>
>><br>
>> This is quite different.<br>
>> I donŽt know how but I was looking at some other older patch around<br>
>> the same issue and I supposed that it was the one refered by Yohan<br>
>> Tibell.<br>
>><br>
>> IŽll try your patch.<br>
>><br>
>> Thanks!.<br>
>><br>
>> 2012/2/7 Holger Reinhardt <<a href="mailto:hreinhardt@gmail.com">hreinhardt@gmail.com</a>>:<br>
>> > Hi,<br>
>> ><br>
>> > (I submitted the patch that Johan linked to)<br>
>> > Network/Socket/Internal.hsc has the following code:<br>
>> ><br>
>> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS)<br>
>> > type CSaFamily = (#type unsigned short)<br>
>> > #elif defined(darwin_HOST_OS)<br>
>> > type CSaFamily = (#type u_char)<br>
>> > #else<br>
>> > type CSaFamily = (#type sa_family_t)<br>
>> > #endif<br>
>> ><br>
>> > You have patched this part to always use 'unsigned short'. But the real<br>
>> > issue is that WITH_WINSOCK is not defined, even though it should be. The<br>
>> > reason for this lies in include/HsNet.h:<br>
>> ><br>
>> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)<br>
>> > # define WITH_WINSOCK 1<br>
>> > #endif<br>
>> ><br>
>> > The problem here is that it checks for HAVE_WINSOCK_H, but the configure<br>
>> > script never defines this variable. Instead it defines HAVE_WINSOCK2_H.<br>
>> > It<br>
>> > seems that the network library used Winsock1 in the past and in the<br>
>> > transition to Winsock2 someone forgot to change a few of the #ifdefs.<br>
>> ><br>
>> > My patch just changes all occurences of HAVE_WINSOCK_H<br>
>> > to HAVE_WINSOCK2_H.<br>
>> > You might want to try that and report back if it works for you.<br>
>> ><br>
>> > 2012/2/7 Alberto G. Corona <<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>><br>
>> >><br>
>> >> Hi Johan,<br>
>> >> The patch is not for the current version of network and the code is<br>
>> >> quite different. Basically it is necesary to define this variable as<br>
>> >> "unsigned short" that is the thing intended in the patch. however I<br>
>> >> put it by brute force, without regard of the prerpocessor directives.<br>
>> >> With this change the code compiles well with:<br>
>> >><br>
>> >><br>
>> >><br>
>> >> <a href="http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-on.html" target="_blank">http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-on.html</a><br>
>> >><br>
>> >> However my compiled library lack the methods defined as foreign. IŽll<br>
>> >> keep trying.<br>
>> >><br>
>> >> 2012/2/6 Johan Tibell <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>>:<br>
>> >> > Hi,<br>
>> >> ><br>
>> >> > Someone recently contributed a fix that should make network build<br>
>> >> > with<br>
>> >> > 7.4: <a href="https://github.com/haskell/network/pull/25" target="_blank">https://github.com/haskell/network/pull/25</a><br>
>> >> ><br>
>> >> > Can you see if that works for you? I haven't yet had time to merge<br>
>> >> > and<br>
>> >> > release that fix (I'm on vacation.)<br>
>> >> ><br>
>> >> > -- Johan<br>
>> >> ><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> Haskell-Cafe mailing list<br>
>> >> <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
>> >> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
>> ><br>
>> ><br>
</div></div></blockquote></div><br>