how to use powf or ceilingf function in rtems..
ckim at etri.re.kr
Sun Nov 13 13:54:26 UTC 2016
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.
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:
> 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?
> 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>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users