Problem with eclipse and atan

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
rafix
Posts: 4
Joined: Sat May 25, 2013 10:15 am

Problem with eclipse and atan

Post 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
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Problem with eclipse and atan

Post 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.
rafix
Posts: 4
Joined: Sat May 25, 2013 10:15 am

Re: Problem with eclipse and atan

Post by rafix »

THANK YOU !

fast and effective :D
Post Reply