how to use powf or ceilingf function in rtems..

김찬 ckim at etri.re.kr
Sun Nov 13 13:54:26 UTC 2016


Thanks, Joel,
I added the ‘-lm’ option using XCFLAGS variable (which should be extra compile flags).
So the ‘-lm’ option was given to the compile command (-c) only and was not being given to the link command. So I added –lm option at the end of COBJS list in my Makefile.base (which my Makefile includes).
I tried using XLDCONFIGS but it didn’t’ work I don’t know why.
Thanks!
Chan

From: Joel Sherrill [mailto:joel at rtems.org]
Sent: Saturday, November 12, 2016 11:37 PM
To: 김찬 <ckim at etri.re.kr>
Cc: rtems-users at rtems.org <users at rtems.org>
Subject: Re: how to use powf or ceilingf function in rtems..


On Nov 12, 2016 4:44 AM, "김찬" <ckim at etri.re.kr<mailto:ckim at etri.re.kr>> wrote:
>
> Hello,
>
> I’m trying to make an rtems application which uses some math function.
>
> I put #include <math.h>. When the powf function is in the Init() function, it works,
>
> But when powf is called from another function(I want to call this function from Init..), I get ‘undefined reference to powf’ error.
>
> I tried merning the files into one but it is the same. What can be the problem?

You should only have to include math.h and link against libm. There should be nothing odd.

My first guess is that the -lm argument is before the other .o on the link command.

Check that and if that isn't it, can you produce an example?

> Thanks!
>
> Chan Kim
>
>
>
> 김 찬 (Chan Kim)
>
> 책임연구원, 프로세서연구실, 지능형반도체연구부
>
> 한국전자통신연구원
>
> O) 042-860-5773  C) 010-3418-9152  E) ckim at etri.re.kr<mailto:ckim at etri.re.kr>
>
>
>
>
> _______________________________________________
> users mailing list
> users at rtems.org<mailto:users at rtems.org>
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20161113/2952981e/attachment.html>


More information about the users mailing list