[Flac-dev] Compile problems on OSX

Erik de Castro Lopo erikd-flac at mega-nerd.com
Sat Sep 8 17:54:18 PDT 2007


Hi all,

I've got two problems compiling the current CVS FLAC sources on OSX.

Firstly, the configure script can't find the OGG libraries which were
installed from MacPorts. I have tried:

    ./configure --with-ogg-includes=/opt/local/include \
           --with-ogg-lib=/opt/local/lib

but they are still not found. I notice that in configure.in, you use
a macro called XIPH_PATH_OGG. Is there any reason you don't use the
PKG_CHECK_MODULES mcaro which uses pkg-config underneath? For my 
system pkg-config does the right thing:

    > pkg-config --cflags --libs ogg
    -I/opt/local/include  -L/opt/local/lib -logg  

I will put together a patch for this is you are interested.

Second problem is that I get a compile error when FLAC__HAS_OGG is 0
in src/flac/decode.c:

    decode.c:393: error: 'options' undeclared (first use in this function)

The code in question is this:

    #if FLAC__HAS_OGG
        if(decoder_session->is_ogg) {
            /* Some code here. */
        }
        else
    #else
        (void)decode_options;
    #endif
        {
            /* More code. */
        }

The problem here is that conditional compiles can hide bugs. The code above 
re-written to turn a conditional compile into an always compiled if statement
which will trigger the error regardless of the value of FLAC__HAS_OGG:

        if(FLAC__HAS_OGG && decoder_session->is_ogg) {
            /* Some code here. */
        }
        else
        {
            (void)decode_options;
            /* More code. */
        }

Cheers,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
'Unix beats Windows' - says Microsoft!
http://blogs.zdnet.com/Murphy/index.php?p=459


More information about the Flac-dev mailing list