EmbDev.net

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


von Kim M. (kmadsen)


Rate this post
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.?

von Martin Thomas (Guest)


Rate this post
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?

von Kim M. (kmadsen)


Rate this post
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.

von Kim M. (kmadsen)


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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.