How to include math library on M2M


Sorry if this is a stupid question, but I’m still new to M2M studio.

Previously I had to explicity declare the math library in the Project Wizard under “wmnew script additional options”, like this: -extlib /cygdrive/C/OpenAT/IDE/GCC/ -libname libm.a

How do I add the math library now under M2M? Without explicitly adding it I get error messages like “undefined rederence to ‘cos’”


Quite simple.
Go to Project properties > C/C++ Build > Settings > ARM ELF GCC Linker > Libraries
Add a “m” in the “Libraries” list.
Re-build: it should be OK (notice the -lm option added to the linker command line in the console window).


Thank you very much for this info. :smiley: