4 Replies Latest reply on Jul 11, 2019 4:10 AM by PeSi_1583586

    pow() function does not compile if either  parameter not constant

    PeSi_1583586

      The pow() function does not compile if either the parameters are not constants as shown in the following example

       

      #include <math.h>

      double X = 10.0;

      double Y = 5.0;

       

      void Test()

      {

      double Z;

      Z = pow(10.0, 5.0); // compiles correctly

      Z= pow(X, 5.0); // generates error message 'Undefined reference to pow'

      Z= pow(10.0, Y); generates error message 'Undefined reference to pow'

      Z = pow(X, Y); // Generates error message 'Undefined reference to pow'

      }

      Is this intentional to limit code size? If so, is there a setting which I need to change in order to have full implementation of the pow() function?

      I am using PSoC Creator 4.2