After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 541358 - cross mingw32 gcc: getaddrinfo is not in ws2_32.dll before Windows XP
cross mingw32 gcc: getaddrinfo is not in ws2_32.dll before Windows XP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Windows
: Normal minor
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-03 08:45 UTC by Damien Lespiau
Modified: 2008-07-03 09:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Makes libgstsdp compile with mingw32 (643 bytes, patch)
2008-07-03 08:47 UTC, Damien Lespiau
committed Details | Review

Description Damien Lespiau 2008-07-03 08:45:51 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.
Comment 1 Damien Lespiau 2008-07-03 08:47:21 UTC
Created attachment 113897 [details] [review]
Makes libgstsdp compile with mingw32
Comment 2 Wim Taymans 2008-07-03 09:13:03 UTC
        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.