title: Math library included but error undefined reference to `log'. Can it be the casting?
body: <p>I have a function with the following code:</p>
  
  <pre><code>static void
  calculate_lifetime(uint16_t p_weight){
    double param, result;
    param = (double) p_weight;
    result = log (param);
  }
  </code></pre>
  
  <p>I include the math library, but when I compile I get the error:</p>
  
  <blockquote>
    <p>undefined reference to `log'</p>
  </blockquote>
  
  <p>Am I doing something wrong when casting? When I remove param and put a number like 8 it compiles correctly.I'm compiling for Contiki.</p>