How to include math library on M2M


#1

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/4.0.1.2/arm-elf/lib/thumb/interwork -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’”


#2

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).


#3

Thank you very much for this info. :smiley: