EmbDev.net

Forum: ARM programming with GCC/GNU tools math.h


Author: Kim Madsen (kmadsen)
Posted on:

Rate this post
0 useful
not useful
Hi
Why does it not work.

float logEx,dew_point,mellem = log10(h);
  logEx=0.66077+7.5*t/(237.3+t)+(mellem-2);
  dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
  return dew_point;

I got a linker error.?

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Kim Madsen wrote:
> Hi
> Why does it not work.
>
> float logEx,dew_point,mellem = log10(h);
>   logEx=0.66077+7.5*t/(237.3+t)+(mellem-2);
>   dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
>   return dew_point;
>
> I got a linker error.?

Not enough information. Which error? Option -lm used for linking?

Author: Kim Madsen (kmadsen)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Kim Madsen wrote:
>> Hi
>> Why does it not work.
>>
>> float logEx,dew_point,mellem = log10(h);
>>   logEx=0.66077+7.5*t/(237.3+t)+(mellem-2);
>>   dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
>>   return dew_point;
>>
>> I got a linker error.?
>
> Not enough information. Which error? Option -lm used for linking?

It is undefine reference to  'log10'
This is the arm-gnu I am using.

Author: Kim Madsen (kmadsen)
Posted on:

Rate this post
0 useful
not useful
It is the right answer, a change in the makefile, adding -lm
and it work.
thx

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.