header

Torsten Curdt’s weblog

Compiling aacgain on OSX

There is a nifty tool out there to adjust your mp3/aac collection to a similar volume …without any re-compression or data loss. Cool! But if you have ever tried to compile aacgain1.5 on OSX (Intel) yourself you will notice that the compilation of libfaad fails.

In file included from /usr/include/math.h:28,
                from common.h:341,
                from bits.c:28:
/usr/include/architecture/i386/math.h:378: error: conflicting types for 'lrintf'
common.h:308: error: previous definition of 'lrintf' was here

This could probably be fixed by some configure magic or checking for OSX in the header file. As a quick fix I’ve just commented it out.

--- aacgain-1.5/faad2/libfaad/common.h  2004-09-08 11:43:12.000000000 +0200
+++ aacgain-1.5.fixed/faad2/libfaad/common.h    2006-10-20 01:01:30.000000000 +0200
@@ -302,6 +302,7 @@
         return i;
     }
   #elif (defined(__i386__) && defined(__GNUC__))
+/*
     #define HAS_LRINTF
     // from http://www.stereopsis.com/FPU.html
     static INLINE int lrintf(float f)
@@ -314,6 +315,7 @@
             : "m" (f));
         return i;
     }
+*/
   #endif

Would be really nice to make this package available through fink.

3 Responses to “Compiling aacgain on OSX”

  1. Johnny said, on 31. December 2006 at 21:48

    All you have to do is add the word “long”:

    #define HAS_LRINTF
    // from http://www.stereopsis.com/FPU.html
    static long INLINE int lrintf(float f)

  2. harijay said, on 11. July 2007 at 22:48

    Hi what Johnny said did not work for me ..I get the error
    In file included from drm_dec.c:37:
    common.h:329: error: static declaration of ‘lrintf’ follows non-static declaration
    make[2]: *** [drm_dec.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2

  3. Logan said, on 24. November 2007 at 12:34

    Hey there,

    What you need to do is remove the “static” and replace with “long”:

    long INLINE int lrintf(float f)

    I’m compiling on a Core 2 Duo MacBook, and worked perfectly.

Leave a Reply

Please copy the string uJmFWC to the field below: