1 Reply Latest reply on Sep 9, 2015 12:49 PM by user_14586677

    issue with math.h cos() and TCPWM_WriteCompare

    richard.stein

      I have recently run into an issue of not being able to use the math.h cosine function with an argument that is a variable if TCWPM_WriteCompare() is present. It doesn't even seem to matter if WriteCompare() is opperating on the same variable that cos() is. A compiler error is generated of "Build error: undefined reference to 'cos'." See below for relevant code snippet.

         

      double a = 0; double b = 0;

         

      ....

         

      int main()
      {

         

           TCPWM_Start();

         

           for(;;)
          {
                b = cos(a);
                TCPWM_WriteCompare(a);
          }
      }

         

       

         

      A bare bones project demonstrating this issue is attached. Any feedback on what is causing this error would be appreciated.