[vorbis-dev] Static linking broken

Jeff Squyres jsquyres at lsc.nd.edu
Wed Nov 22 07:37:23 PST 2000



It seems that configuring/building with "--enable-static --disable-shared"
causes some problems with building vorbis-tools -- the Makefile.am's in
oggenc and ogg123 do not appear to be correct.

That is, if you build ao, ogg, and vorbis statically and try to compile
oggenc or ogg123, you'll get unresolved symbol linker errors.  This
happens on all POSIX architectures and compilers.

The solution is easy; use the automake "LIBS" macro instead of
"ogg123_LDFLAGS" and "oggenc_LDFLAGS" (this changes the order of where
flags are placed on the linker command line), and put the libraries in the
correct left-to-right order (it doesn't matter for dynamic linking, but it
does matter for static linking).

Can someone please fix this in CVS?  Here's a diff against the CVS head as
of the morning of 22 Nov, 2000:

Index: ogg123/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.7
diff -c -r1.7 Makefile.am
*** ogg123/Makefile.am	2000/11/18 05:36:32	1.7
--- ogg123/Makefile.am	2000/11/22 15:35:10
***************
*** 10,16 ****

  INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@

! ogg123_LDFLAGS = @OGG_LIBS@ @VORBIS_LIBS@ @VORBISFILE_LIBS@ @AO_LIBS@

  ogg123_SOURCES = ogg123.c

--- 10,16 ----

  INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@

! LIBS = @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@

  ogg123_SOURCES = ogg123.c

Index: oggenc/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/Makefile.am,v
retrieving revision 1.6
diff -c -r1.6 Makefile.am
*** oggenc/Makefile.am	2000/11/18 04:30:02	1.6
--- oggenc/Makefile.am	2000/11/22 15:35:10
***************
*** 8,14 ****

  INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@

! oggenc_LDFLAGS = @OGG_LIBS@ @VORBIS_LIBS@ @VORBISENC_LIBS@
  oggenc_SOURCES = oggenc.c audio.c encode.c oe_unix.c getopt.c getopt1.c\
                  oe_win32.c\
                  audio.h encode.h platform.h getopt.h
--- 8,14 ----

  INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@

! LIBS = @VORBIS_LIBS@ @VORBISENC_LIBS@ @OGG_LIBS@
  oggenc_SOURCES = oggenc.c audio.c encode.c oe_unix.c getopt.c getopt1.c\
                  oe_win32.c\
                  audio.h encode.h platform.h getopt.h

{+} Jeff Squyres
{+} squyres at cse.nd.edu
{+} Perpetual Obsessive Notre Dame Student Craving Utter Madness
{+} "I came to ND for 4 years and ended up staying for a decade"

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list