GNOME Bugzilla – Bug 541358
cross mingw32 gcc: getaddrinfo is not in ws2_32.dll before Windows XP
Last modified: 2008-07-03 09:13:03 UTC
libgstsdp uses getaddrinfo and freeaddrinfo functions. These functions are not in the winsocks DLL before windows XP. mingw32 knows this and its ws2tcpip.h does not declare them unless the WINVER macro is set to Windows XP or above. Thus, when trying to cross-compile with mingw32 from a linux box, the build stop with: ../../../../gst-plugins-base-0.10.20/gst-libs/gst/sdp/gstsdpmessage.c: In function `is_multicast_address': ../../../../gst-plugins-base-0.10.20/gst-libs/gst/sdp/gstsdpmessage.c:334: warning: implicit declaration of function `getaddrinfo' ../../../../gst-plugins-base-0.10.20/gst-libs/gst/sdp/gstsdpmessage.c:350: warning: implicit declaration of function `freeaddrinfo' and at link time: /home/damien/src/build-gst-plugins-base-0.10.20/gst-libs/gst/sdp/../../../../gst-plugins-base-0.10.20/gst-libs/gst/sdp/gstsdpmessage.c:334: undefined reference to `_getaddrinfo' /home/damien/src/build-gst-plugins-base-0.10.20/gst-libs/gst/sdp/../../../../gst-plugins-base-0.10.20/gst-libs/gst/sdp/gstsdpmessage.c:350: undefined reference to `_freeaddrinfo' The right thing to do would be to provide a replacement for those functions to support systems like windows 2000 (and maybe some Unixes) but for now I have a patch to fix the build issue knowing that the DLL won't work with windows 2000 or earlier. This patch should not break anything and makes -base compile with mingw32 so it still can be useful while waiting for someone that needs to have gstreamer SDP working for windows 2000.
Created attachment 113897 [details] [review] Makes libgstsdp compile with mingw32
Patch by: Damien Lespiau <damien dot lespiau at gmail dot com> * gst-libs/gst/sdp/gstsdpmessage.c: Makes libgstsdp compile with mingw32 by defining the right WINVER so that getaddrinfo() can be used. Fixes #541358.