GNOME Bugzilla – Bug 557300
libgstnet needs to link against $(WIN32_LIBS)
Last modified: 2008-11-03 10:59:55 UTC
Please describe the problem: configure.ac says: AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes) AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes") if test "x$HAVE_WINSOCK2_H" = "xyes"; then WIN32_LIBS="-lws2_32" AC_SUBST(WIN32_LIBS) fi But while $WIN32_LIBS is defined to "-lws2_32" and is present in all Makefiles, it is never used anywhere, and ws2_32 is indeed never linked. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Workaround: define LIBS in configure call like this: configure LIBS="-lws2_32"
It's used in gst/Makefile.am, as well as gst-libs/gst/rtsp/Makefile.am in gst-plugins-base. Marking as NOTABUG on the assumption that you merely overlooked where $(WIN32_LIBS) is used.
Oh...you are correct, of course. It is used in gst/Makefile.am . Still, that does not explains this: Making all in net make[4]: Entering directory `/d/projects/gstreamer-0.10.21/libs/gst/net' /bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnetclientclock.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnetclientclock.Tpo -c -o libgstnet_0.10_la-gstnetclientclock.lo `test -f 'gstnetclientclock.c' || echo './'`gstnetclientclock.c mkdir .libs gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnetclientclock.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnetclientclock.Tpo -c gstnetclientclock.c -DDLL_EXPORT -DPIC -o .libs/libgstnet_0.10_la-gstnetclientclock.o gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnetclientclock.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnetclientclock.Tpo -c gstnetclientclock.c -o libgstnet_0.10_la-gstnetclientclock.o >/dev/null 2>&1 mv -f .deps/libgstnet_0.10_la-gstnetclientclock.Tpo .deps/libgstnet_0.10_la-gstnetclientclock.Plo /bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimepacket.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimepacket.Tpo -c -o libgstnet_0.10_la-gstnettimepacket.lo `test -f 'gstnettimepacket.c' || echo './'`gstnettimepacket.c gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimepacket.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimepacket.Tpo -c gstnettimepacket.c -DDLL_EXPORT -DPIC -o .libs/libgstnet_0.10_la-gstnettimepacket.o gstnettimepacket.c: In function 'gst_net_time_packet_receive': gstnettimepacket.c:130: warning: pointer targets in passing argument 2 of 'recvfrom' differ in signedness gstnettimepacket.c: In function 'gst_net_time_packet_send': gstnettimepacket.c:202: warning: pointer targets in passing argument 2 of 'sendto' differ in signedness gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimepacket.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimepacket.Tpo -c gstnettimepacket.c -o libgstnet_0.10_la-gstnettimepacket.o >/dev/null 2>&1 mv -f .deps/libgstnet_0.10_la-gstnettimepacket.Tpo .deps/libgstnet_0.10_la-gstnettimepacket.Plo /bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimeprovider.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimeprovider.Tpo -c -o libgstnet_0.10_la-gstnettimeprovider.lo `test -f 'gstnettimeprovider.c' || echo './'`gstnettimeprovider.c gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimeprovider.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimeprovider.Tpo -c gstnettimeprovider.c -DDLL_EXPORT -DPIC -o .libs/libgstnet_0.10_la-gstnettimeprovider.o gstnettimeprovider.c: In function 'gst_net_time_provider_start': gstnettimeprovider.c:387: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -MT libgstnet_0.10_la-gstnettimeprovider.lo -MD -MP -MF .deps/libgstnet_0.10_la-gstnettimeprovider.Tpo -c gstnettimeprovider.c -o libgstnet_0.10_la-gstnettimeprovider.o >/dev/null 2>&1 mv -f .deps/libgstnet_0.10_la-gstnettimeprovider.Tpo .deps/libgstnet_0.10_la-gstnettimeprovider.Plo /bin/sh ../../../libtool --tag=CC --mode=link gcc -I../../../libs -I../../.. -I../../.. -mms-bitfields -ID:/msys/local/include/glib-2.0 -ID:/msys/local/lib/glib-2.0/include -ID:/msys/local/include/libxml2 -Wall -Wdeclaration-after-statement -g -g -O2 -export-symbols-regex \^_*\(gst_\|Gst\|GST_\).* -no-undefined -version-info 18:0:18 -o libgstnet-0.10.la -rpath /usr/local/lib libgstnet_0.10_la-gstnetclientclock.lo libgstnet_0.10_la-gstnettimepacket.lo libgstnet_0.10_la-gstnettimeprovider.lo ../../../gst/libgstreamer-0.10.la -LD:/msys/local/lib -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -L/usr/local/lib -lintl libtool: link: warning: `D:/msys/local/lib/libintl.la' seems to be moved libtool: link: warning: `D:/msys/local/lib/libxml2.la' seems to be moved generating symbol list for `libgstnet-0.10.la' /mingw/bin/nm .libs/libgstnet_0.10_la-gstnetclientclock.o .libs/libgstnet_0.10_la-gstnettimepacket.o .libs/libgstnet_0.10_la-gstnettimeprovider.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 _\2 \2/p' | /bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > .libs/libgstnet-0.10.exp /bin/grep -E -e "^_*(gst_|Gst|GST_).*" ".libs/libgstnet-0.10.exp" > ".libs/libgstnet-0.10.expT" mv -f ".libs/libgstnet-0.10.expT" ".libs/libgstnet-0.10.exp" if test "x`/bin/sed 1q .libs/libgstnet-0.10.exp`" = xEXPORTS; then cp .libs/libgstnet-0.10.exp .libs/libgstnet-0.10-0.dll.def; else echo EXPORTS > .libs/libgstnet-0.10-0.dll.def; cat .libs/libgstnet-0.10.exp >> .libs/libgstnet-0.10-0.dll.def; fi gcc -shared .libs/libgstnet-0.10-0.dll.def .libs/libgstnet_0.10_la-gstnetclientclock.o .libs/libgstnet_0.10_la-gstnettimepacket.o .libs/libgstnet_0.10_la-gstnettimeprovider.o ../../../gst/.libs/libgstreamer-0.10.dll.a -LD:/msys/local/lib -L/usr/local/lib -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 /usr/local/lib/libintl.dll.a -mms-bitfields -o .libs/libgstnet-0.10-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgstnet-0.10.dll.a Info: resolving ___gst_debug_min by linking to __imp____gst_debug_min (auto-import) Info: resolving _GST_CAT_DEFAULT by linking to __imp__GST_CAT_DEFAULT (auto-import) Creating library file: .libs/libgstnet-0.10.dll.ad:\mingw\bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs..libs/libgstnet_0.10_la-gstnetclientclock.o: In function `gst_net_client_clock_start': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:431: undefined reference to `_socket@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:437: undefined reference to `_getsockname@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:443: undefined reference to `_htons@4' .libs/libgstnet_0.10_la-gstnetclientclock.o: In function `inet_aton': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:112: undefined reference to `_inet_addr@4' .libs/libgstnet_0.10_la-gstnetclientclock.o: In function `gst_net_client_clock_start': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:445: undefined reference to `_ntohs@4' .libs/libgstnet_0.10_la-gstnetclientclock.o: In function `gst_net_client_clock_finalize': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:202: undefined reference to `_WSACleanup@0' .libs/libgstnet_0.10_la-gstnetclientclock.o: In function `gst_net_client_clock_init': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:158: undefined reference to `_WSAStartup@8' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnetclientclock.c:164: undefined reference to `_WSACleanup@0' .libs/libgstnet_0.10_la-gstnettimepacket.o: In function `gst_net_time_packet_send': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimepacket.c:199: undefined reference to `_ioctlsocket@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimepacket.c:202: undefined reference to `_sendto@24' .libs/libgstnet_0.10_la-gstnettimepacket.o: In function `gst_net_time_packet_receive': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimepacket.c:129: undefined reference to `_recvfrom@24' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `gst_net_time_provider_start': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:360: undefined reference to `_socket@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:366: undefined reference to `_setsockopt@20' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:374: undefined reference to `_htons@4' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `inet_aton': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:118: undefined reference to `_inet_addr@4' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `gst_net_time_provider_start': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:380: undefined reference to `_bind@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:387: undefined reference to `_getsockname@12' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:391: undefined reference to `_ntohs@4' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:444: undefined reference to `_closesocket@4' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:419: undefined reference to `_closesocket@4' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:427: undefined reference to `_closesocket@4' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:435: undefined reference to `_closesocket@4' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `gst_net_time_provider_stop': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:461: undefined reference to `_closesocket@4' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `gst_net_time_provider_finalize': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:212: undefined reference to `_WSACleanup@0' .libs/libgstnet_0.10_la-gstnettimeprovider.o: In function `gst_net_time_provider_init': d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:171: undefined reference to `_WSAStartup@8' d:\projects\gstreamer-0.10.21\libs\gst\net/gstnettimeprovider.c:177: undefined reference to `_WSACleanup@0 ' collect2: ld returned 1 exit status make[4]: *** [libgstnet-0.10.la] Error 1 I suspect that this is caused by the fact that gst/Makefile.am does not have any links to libs/gst/net/Makefile.am
Created attachment 121083 [details] [review] patch Add WIN32_LIBS to libgstnet LIBADD.
Ok, that build failure makes more sense. Try this patch, let me know if it completely fixes the problem, or we need to add WIN32_LIBS somewhere else as well.
Yes, looks like it works correctly now.
David, any reason why you didn't commit this yet? :)
Patch by: David Schleef <ds@schleef.org> * libs/gst/net/Makefile.am: Add WIN32_LIBS to libgstnet LIBADD. Fixes #557300.