incompatible implicit declaration of built-in functions

Philippe C.D. Robert philippe.robert at gmx.net
Tue Mar 27 02:34:15 PDT 2007


Uli Kusterer schrieb:
> Am 26.03.2007 um 20:18 schrieb Philippe C.D. Robert:
>> warning: incompatible implicit declaration of built-in function 'xyz'
> 
>  Is it really, literally, xyz, or what functions do you get complaints 
> about? Have you got any other functions or macros that use the same name?

Sorry, xyz is a placeholder for the functions.

>  Have you tried running GCC over the file in question to just preprocess 
> the files and see what code comes out? There's a flag that tells GCC to 
> just preprocess files, which pastes included code into one huge source 
> file and removes conditionalized code that has been #ifdefed out. Very 
> handy in tracking down missing include guards, unexpected side-effects 
> of macros in unknown code or whatever.

Thanks, good suggestion, I will try that.

>> I do include <math.h>, I also tried to pass -lm to gcc, but so far w/o 
>> any success. What am I missing?
> 
>  Do you have any other header in your project that has the same name 
> (maybe only uppercase or whatever), which could be accidentally picked 
> up instead? Xcode occasionally gets a bit confused about such things.

Hmmm, my maths file is called math.h, which in turn includes <math.h>. 
Then, every C file in my project - which requires maths stuff - includes 
"math.h" and not <math.h>. Could this be the problem?

>  Is this really C, or C++? Are you including <math.h> or <cmath>? Is 
> there anyplace where someone is including the header in another 
> namespace? That might cause the functions to be imported as std::ceilf() 
> or even foo::ceilf() and obviously your other code outside that 
> namespace might not see it.

It is plain C; and it's <math.h> I include.

Cheers,

-Phil


More information about the MacOSX-dev mailing list