[Vorbis] RE: Oggenc/oggdec on Mac OS X

Ralph Giles giles at xiph.org
Tue Nov 15 13:39:13 PST 2005


On Tue, Nov 15, 2005 at 10:31:51PM +0100, Mikael Hillborg wrote:

> Yes, the .a libs are built when you run "make all" on the libogg 
> and libvorbis distributions from a console. But how do you build the
> vorbistools oggenc and oggdec to link against these .a libs and not 
> in runtime using the .dylibs? That's the question. 

The normal procedure is to pass '-static' to the linker, which tells it 
to prefer the static versions. (This can be done iirc by passing 
--enable-static to configure.) But that applies to all libs, not just 
the ogg and vorbis ones, so it fails when it can't find a static version
of libcrt or whaterver it is Apple isn't including anymore.

You can force it to use static versions of specific libraries by passing 
the full path to the .a instead of the -lname option, which uses the 
standard search logic. For example,

gcc -o oggenc oggenc.o foo.o -lvorbisenv -lvorbis -lm -logg

would become

gcc -o oggenc oggenc.o foo.o /usr/local/lib/libvorbisenc.a \
  /usr/local/lib/libvorbis.a /usr/local/lib/libogg.a -lm

Try variations on that and see if you can get something to work.

> Another problem...
> I tried building with Xcode instead, using the project file (vorbis.pbproj) 
> in libvorbis-1.1.1 to see if I can build and link as static libs. But the 
> project file refers to misc.c and .cvsignore. There are no such files in 
> the distribution. Neither in libogg-1.1.2 nor in vorbis-tools-1.1.1.
> Compiling without them, in Xcode, results in a number of error messages. 
> Anyone has a clue why?

Sounds like the project files are bitrotted. Patches welcome if you get 
it going.

.cvsignore is an old file from the CVS repository, no longer in use. It 
shouldn't be in the project at all. misc.c is in 
http://svn.xiph.org/trunk/vorbis/lib/ but isn't part of the standard 
build and shouldn't be in the source list. Probably someone (me, even?) 
just dragged the whole directory in there, and it did no harm, but since 
they're not part of any defined build, they didn't get included in the 
release tarball.

Anyway, the build should go fine without them. Can't comment on why it 
didn't without more information.

HTH,
 -r


More information about the Vorbis mailing list