AnsweredAssumed Answered

CW 10.6 Kinetis - "incompatible implicit declaration" of all math.h functions?

Question asked by David Rodgers on Sep 26, 2014
Latest reply on Oct 3, 2014 by Pascal Irrle

I've run into this previously on an earlier project, but it was easy to patch over because there was exactly one math reference.  This project is chock full of them, so I need to nip this in the bud.

 

Quite simply, it seems that #include <math.h> isn't doing any good, because the compiler isn't seeing any prototypes, and I'm getting a ton of messages like this:

 

../Sources/CalcLib/calcDenVisc.c: In function 'calcViscosity'

../Sources/CalcLib/calcDenVisc.c:81:9: warning: implicit declaration of function 'exp' [-Wimplicit-function-declaration]

../Sources/CalcLib/calcDenVisc.c: In function 'calcDensity':

../Sources/CalcLib/calcDenVisc.c:169:9: warning: implicit declaration of function 'pow' [-Wimplicit-function-declaration]

../Sources/CalcLib/calcDenVisc.c:176:9: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]

../Sources/CalcLib/calcDenVisc.c:200:19: warning: incompatible implicit declaration of built-in function 'pow' [enabled by default]

../Sources/CalcLib/calcFlow.c: In function 'calcFlow':

../Sources/CalcLib/calcFlow.c:59:9: warning: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]

../Sources/CalcLib/calcFlow.c:155:7: warning: incompatible implicit declaration of built-in function 'fabs' [enabled by default]

../Sources/CalcLib/calcFlow.c: In function 'updateHiResTot':

../Sources/CalcLib/calcFlow.c:233:7: warning: incompatible implicit declaration of built-in function 'fabs' [enabled by default]

../Sources/CalcLib/calcSupport.c: In function 'calcHdlr_doCalcStep':

../Sources/CalcLib/calcSupport.c:249:17: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]

../Sources/CalcLib/calcSupport.c:258:17: warning: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]

 

I'm running CW for MCU 10.6, with MQX v4.1.1 (had this issue with an MQX 4.0 project, too), compiling for a K20 120MHz target.  This is the only system library that I seem to have issues with.  Is there some special preprocessor define that I need to set in my project?  (I have _EWL_C99=1 and __VFPV4__=1 defined in the preprocessor.)

Outcomes