[Flac-dev] Compiling static libFLAC.a still requires libogg.dylib

Glenn McCord glenn.mccord at gmail.com
Mon Aug 16 20:09:08 PDT 2010

Thanks for the reply. I would very much like OGG container support, so
disabling it isn't really an option. I have built OGG so that it
creates a libogg.a, libogg.0.dylib and a symbolically linked
libogg.dylib (that links to the libogg.0.dylib) file.

If I remove the .dylib files in an attempt to 'encourage' the compiler
to use libogg.a, then it complains that it can't find the .dylib file.

When I do that, the error looks like

libtool: link: gcc -I/Users/glennm/libOGG-i386/include -O3
-funroll-loops -finline-functions -Wall -W -Winline -arch i386 -arch
i386 -o flac analyze.o decode.o encode.o foreign_metadata.o main.o
local_string_utils.o utils.o vorbiscomment.o
../../src/share/utf8/.libs/libutf8.a ../../src/libFLAC/.libs/libFLAC.a
/Users/glennm/libOGG-i386/lib/libogg.dylib -liconv -lm
/Users/glennm/libOGG-i386/lib/libogg.dylib: No such file or directory

Could this be something to do with the way libtool has been set up?

On Tue, Aug 17, 2010 at 2:57 PM, Brian Willoughby <brianw at sounds.wa.com> wrote:
> On Aug 16, 2010, at 16:44, Glenn McCord wrote:
>> Hi, I'm trying to compile a static lib of libFLAC yet whenever I use
>> it in an application, the application will fail on other machines
>> because it's trying to use libogg.0.dylib.
>> I'm using the following configure command
>> ./configure prefix=${HOME}/libFLAC --disable-asm-optimizations
>> --disable-dependency-tracking --with-ogg=${HOME}/libOGG
>> --enable-shared=no
>> but to do avail. Is there something else that I need to do? I'm on
>> OSX, if that matters.
> A couple of things,
> As long as you link to a .dylib, it won't be completely static.  The FLAC
> part might be static, but the OGG part is still going to be dynamic unless
> you rebuild some kind of libogg.a that is also static, first.
> There is also a configure/build option, I remember, to build the FLAC
> library without any Ogg support.  That could be a serious omission, but if
> it works it should remove the libogg.dylib dependency.
> I'm also on OSX, having created the installer, but I have not tried to
> divorce FLAC from Ogg.  When I saw the dependency, I just downloaded Ogg and
> built it, too.  In your case, you may have to build Ogg differently, or
> remove it completely, as I mention above.
> Brian Willoughby
> Sound Consulting

More information about the Flac-dev mailing list