atmel-software-package
atmel-software-package copied to clipboard
Can't compile code calling sin, cos, tan etc....
Hi All,
I am having issues attempting to build code that include sin/cos/tan etc trig functions.... I am getting linker errors, e.g.
undefined reference to
asin'`
I am guessing this is the wrong forum (sorry in advance) but I am wondering what I need to do to make these trig functions build? Where can I find the right link options/library that I need?
Many thanks in advance.
Paul.
FYI: I can compile these functions successfully using GCC & IAR by adding #include "math.h"
, the results are also correct (optimization level: none).
Code:
float ii;
ii = sin(0.2);
ii = cos(2.0);
ii = tan(1.0);
Version info: gcc version 8.2.1 20181213 (release) [gcc-8-branch revision 267074] (GNU Tools for Arm Embedded Processors 8-2018-q4-major) IAR Embedded Workbench for ARM 7.80.2.11975 IAR Embedded Workbench shared components 7.54.4636