Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 8, 2011, 07:16 AM   #1
MrFusion
macrumors 6502a
 
Join Date: Jun 2005
Location: West-Europe
implicit declaration of function warning

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.

Code:
#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
__________________
24" iMac, 13" MacBook, iPod Touch. iPod mini and PowerPC Mac Mini gathering dust somewhere.
MrFusion is offline   0 Reply With Quote
Old Apr 8, 2011, 07:38 AM   #2
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
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.

Last edited by jiminaus; Apr 8, 2011 at 07:56 AM.
jiminaus is offline   0 Reply With Quote
Old Apr 8, 2011, 10:12 AM   #3
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by jiminaus View Post
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?
Maybe there's a sgetrf() macro somewhere that's defined in terms of sgetrf_().
chown33 is offline   0 Reply With Quote
Old Apr 8, 2011, 10:20 AM   #4
MrFusion
Thread Starter
macrumors 6502a
 
Join Date: Jun 2005
Location: West-Europe
Quote:
Originally Posted by jiminaus View Post
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.
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.
__________________
24" iMac, 13" MacBook, iPod Touch. iPod mini and PowerPC Mac Mini gathering dust somewhere.
MrFusion is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Can't find interface declaration cpuin iPhone/iPad Programming 6 Mar 23, 2014 04:08 PM
Global function -> normal function? DennisBlah iPhone/iPad Programming 6 Feb 28, 2014 01:40 AM
Instance variable declaration: best practices? MacMan988 iPhone/iPad Programming 1 Jan 26, 2014 07:21 AM
C Function from NSString? ArtOfWarfare Mac Programming 20 Jun 16, 2013 10:55 AM

Forum Jump

All times are GMT -5. The time now is 10:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC