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 573593 - Linking static directx libraries to gstdirect* plugins on Windows
Linking static directx libraries to gstdirect* plugins on Windows
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-01 01:26 UTC by LRN
Modified: 2009-08-09 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Link libdxguid.a and libdxerr9 statically (932 bytes, patch)
2009-03-01 01:27 UTC, LRN
none Details | Review
Link dxguid and dxerr9 statically. Fixed an error (wrote things in wrong place). (832 bytes, patch)
2009-03-04 10:25 UTC, LRN
none Details | Review
Pass -ldxerr9 around libtool via -Wl (1.08 KB, patch)
2009-06-15 10:16 UTC, LRN
rejected Details | Review
.la file for libdxerr9.a (906 bytes, text/plain)
2009-06-17 11:12 UTC, LRN
  Details

Description LRN 2009-03-01 01:26:05 UTC
gstdirectdrawsink and gstdirectsoundsink depend on libdxguid.a and libdxerr9.a
Both .a files are static libraries (not import libraries) and do not have corresponding .dll files. According to libtool, they can only be linked to applications (executables), but not to .dlls, since linking static library to shared library may have unpleasant consequences on most OSes. Fortunately, gstdirecdrawsink and gstdirectsoundsink are THE cases when it is safe to link static library - there's no possibility of symbol duplication, they are C-only (right?) and PIC doesn't matter because .dlls don't support PIC. Unfortunately, libtool developers are aiming to be cross-platform and do not wish to implement features in libtool that are exclusive for some platforms (such as Win32). Because of that libtool can't (and won't) allow us to link these libraries to these plugins.

Roumen Petrov suggested that one can pass library dependencies via "-Wl," syntax, in which case they are ignored by libtool.
Comment 1 LRN 2009-03-01 01:27:36 UTC
Created attachment 129757 [details] [review]
Link libdxguid.a and libdxerr9 statically

Seems to be working correctly (both video and audio) from gst-launch.
Comment 2 Michael Smith 2009-03-01 01:59:03 UTC
FWIW, libtool links these plugins fine for me without requiring any changes.

libtool is stupid in this case (well, more stupid than normal).
Comment 3 LRN 2009-03-01 02:21:06 UTC
Maybe you DO have the .dll files in question and your copies of .a files are import libraries rather than static libraries? Where did you got your MinGW, DirectX SDK and which version are they?
I also heard that it is possible to use specially crafted .la file to substitute for a lack of .dll, but i never managed to get it working that way.
Comment 4 LRN 2009-03-04 10:23:09 UTC
Comment on attachment 129757 [details] [review]
Link libdxguid.a and libdxerr9 statically

diff --git a/configure.ac b/configure.ac
index 5412d79..c0a2921 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,7 +380,8 @@ int main ()
 
   if test "x$HAVE_DIRECTDRAW" = "xyes";  then
     dnl this is much more than we want
-    DIRECTDRAW_LIBS="-lddraw -ldxguid -lgdi32"
+    DIRECTDRAW_LIBS="-lddraw -lgdi32"
+    DIRECTDRAW_CFLAGS="-Wl,-ldxguid"
     AC_SUBST(DIRECTDRAW_CFLAGS)
     AC_SUBST(DIRECTDRAW_LDFLAGS)
     AC_SUBST(DIRECTDRAW_LIBS)
@@ -421,7 +422,8 @@ int main ()
 
   if test "x$HAVE_DIRECTSOUND" = "xyes";  then
     dnl this is much more than we want
-    DIRECTSOUND_LIBS="-ldsound -ldxerr9 -luser32"
+    DIRECTSOUND_CFLAGS="-Wl,-ldxerr9"
+    DIRECTSOUND_LIBS="-ldsound -luser32"
     AC_SUBST(DIRECTSOUND_CFLAGS)
     AC_SUBST(DIRECTSOUND_LDFLAGS)
     AC_SUBST(DIRECTSOUND_LIBS)
Comment 5 LRN 2009-03-04 10:25:03 UTC
Created attachment 130001 [details] [review]
Link dxguid and dxerr9 statically.
Fixed an error (wrote things in wrong place).
Comment 6 LRN 2009-06-15 10:16:58 UTC
Created attachment 136617 [details] [review]
Pass -ldxerr9 around libtool via -Wl

Since directdraw is not in -good anymore, i had to alter the patch. And it looks a bit different (just changed LIBS, without adding CFLAGS).
Comment 7 LRN 2009-06-17 11:12:15 UTC
Created attachment 136820 [details]
.la file for libdxerr9.a

OK, i've tried the .la solution and finally got it working. Attached .la file as an example. When placed in /mingw/lib alongside with libdxerr9.a, it satisfies libtool. No, i don't know how (or why) it works. It just does.

I'm going to report that on MinGW bug tracker and see what they have to say about it. Meanwhile, since it's not GStreamer's fault, this bug should be closed until further notice.
Comment 8 Sebastian Dröge (slomo) 2009-08-09 10:23:42 UTC
Ok, closing as NOTGNOME then.