Hello,
how add math function to a segger project.
I have included
#include <math.h>
void myFuncion()
{
. . .
rx=(int)((float)(*x-cx)* cos(a) -(float)(*y-cy)*sin(a)+cx);
. . .
}
but i get error
undefined reference to 'cos'
Hello,
how add math function to a segger project.
I have included
#include <math.h>
void myFuncion()
{
. . .
rx=(int)((float)(*x-cx)* cos(a) -(float)(*y-cy)*sin(a)+cx);
. . .
}
but i get error
undefined reference to 'cos'
Hi,
The problem is probably that you are using Zephyr's minimal libc implementation, which is missing a lot of features normally present in libc.
You can change to using the newlib implementation by setting CONFIG_NEWLIB_LIBC=y in your prj.conf file. (Remember that if you are using SES, changes in prj.conf doesn't take effect until you re-open the project or use 'Project -> Run CMake...')
Note that newlib can also be configured to exclude a lot of features (to save space). This means that you might also have to configure your project to not use newlib-nano, but the full newlib implementation. You can do that by setting CONFIG_NEWLIB_LIBC_NANO=n.
Best regards,
Didrik
Hi Didrik,
Perfect now compile and work.
Best regards
Fausto
Hi Didrik,
Perfect now compile and work.
Best regards
Fausto
my sin function working by following above steps but I cannot use the inverse trignometry