On Thu, Jan 31, 2002 at 09:51:25PM -0800, Chris Campbell wrote:
> I'm working on a FLAC plugin for the Java Media Framework (JMF) on Mac
> OS X. I'm having some trouble linking to libFLAC... When I first try
to
> link to it, it tells me the libFLAC.a TOC is out of date, so run ranlib.
> So then I run ranlib, and it seems to be okay, except I then get
> undefined symbol errors:
>
> % cc -bundle -I/System/Library/Frameworks/JavaVM.framework/Headers
> -I./flac-1.0.2-osx-ppc/include/ -L./flac-1.0.2-osx-ppc/lib/ -lFLAC -o
> libflacjmf.jnilib -framework JavaVM flacdecoder.c
> /usr/bin/ld: Undefined symbols:
> _FLAC__stream_decoder_process_metadata
>
> I've tried it even without the Java-specific options, and it still
fails.
>
> Has anyone had any luck linking with libFLAC on OS X? Any help would be
> appreciated.
In general, you should link libraries in at the end of the command line.
This is so that unresolved symbols which are found earlier in the command
line can be correctly resolved. Try moving -lFLAC to the end.
--
- mdz