Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile code calling sin, cos, tan etc.... #106

Open
PaulMadle opened this issue Dec 4, 2020 · 1 comment
Open

Can't compile code calling sin, cos, tan etc.... #106

PaulMadle opened this issue Dec 4, 2020 · 1 comment

Comments

@PaulMadle
Copy link

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.

@TonyHan11
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants