Page 1 of 1

Problem with eclipse and atan

Posted: Sat May 25, 2013 10:22 am
by rafix
Hi all,

i'm using eclipse to make some simple projects with a stm32f303 discovery.
i want to use the atan function or something similar but when i include math.h and use atan, i have the following error:

/home/myName/workspaceChibios/CompassTest//main.c:184: undefined reference to `atan'

I have read about using -lm or add an "m" into libraries, but i cant to that by project property.

Any ideas?

Thanks

Re: Problem with eclipse and atan

Posted: Sat May 25, 2013 10:30 am
by Abhishek
I suppose you are using Eclipse with linux, and you are using the ChibiOS makefiles, right?

You should add '-lm' to the makefile to the DLIBS section of the Makefile. It should work then.

Re: Problem with eclipse and atan

Posted: Sat May 25, 2013 10:38 am
by rafix
THANK YOU !

fast and effective :D