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;

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

  • Logan
    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.
  • 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
  • Johnny
    All you have to do is add the word "long":

    #define HAS_LRINTF
    // from http://www.stereopsis.com/FPU....
    static long INLINE int lrintf(float f)
blog comments powered by Disqus