# How to include math library on M2M

**URL:** <https://forum.sierrawireless.com/t/how-to-include-math-library-on-m2m/2969>\
**Category:** Development tools\
**Created:** [February 23, 2009, 11:46am UTC](https://forum.sierrawireless.com/t/how-to-include-math-library-on-m2m/2969 "2009-02-23T11:46:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wtb](https://avatars.discourse-cdn.com/v4/letter/w/53a042/32.png) [@wtb](https://forum.sierrawireless.com/u/wtb)\
**Post date:** [February 23, 2009, 11:46am UTC](https://forum.sierrawireless.com/t/how-to-include-math-library-on-m2m/2969/1 "2009-02-23T11:46:51Z")

</div>

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’”

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/daav/32/2767_2.png) [@daav](https://forum.sierrawireless.com/u/daav)\
**Post date:** [February 24, 2009, 9:28am UTC](https://forum.sierrawireless.com/t/how-to-include-math-library-on-m2m/2969/2 "2009-02-24T09:28:43Z")

</div>

> [@wtb](#):
>
> How do I add the math library now under M2M?

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

---

<div class="post-metadata">

**Author:** ![wtb](https://avatars.discourse-cdn.com/v4/letter/w/53a042/32.png) [@wtb](https://forum.sierrawireless.com/u/wtb)\
**Post date:** [March 10, 2009, 2:16pm UTC](https://forum.sierrawireless.com/t/how-to-include-math-library-on-m2m/2969/3 "2009-03-10T14:16:41Z")

</div>

Thank you very much for this info. 😃
