implicit declaration of function warning

Discussion in 'Mac Programming' started by MrFusion, Apr 8, 2011.

  1. macrumors 6502a

    Jun 8, 2005
    I am using the accelerate framework, but get "implicit declaration of function" warnings when using the sgetrf() and sgetrs() functions.
    The code works fine, but those two warnings annoy the hell out me.
    I don't think I should define those functions anywhere since they are already defined in the clapack header.

    Any idea how to get rid of these warnings? Thanks.

    #import "MyObject.h"
    #import <Accelerate/Accelerate.h>
    #import <vecLib/vecLib.h> //does not get rid of warning
    #import <vecLib/clapack.h> //does not get rid of warning
    // #import <Accelerate/vecLib/clapack.h> //does not compile
  2. jiminaus, Apr 8, 2011
    Last edited: Apr 8, 2011

    macrumors 65816


    Dec 16, 2010
    Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

    EDIT: Because we're calling Fortran code, so apparently the trailing underscore is to be expected. It also explains why all the arguments are passed by reference. However the examples in the Use the Accelerate Framework for Data Processing guide doesn't show the trailing underscores.
  3. macrumors 604

    Aug 9, 2009
    Maybe there's a sgetrf() macro somewhere that's defined in terms of sgetrf_().
  4. thread starter macrumors 6502a

    Jun 8, 2005
    That does the trick. Thanks. I also doubt the underscore was present in the examples I found a while back and I obviously overlooked them in the header file.

Share This Page