Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Knowledge Base Articles

Using Math Functions in PSoC® Creator™ for the PSoC 4 or PSoC 5LP GCC Compiler – KBA93076

KishoreS_96
Employee
First like received
Employee

Using Math Functions in PSoC® Creator™ for the PSoC 4 or PSoC 5LP GCC Compiler – KBA93076

Version: **

Translation - Japanese: PSoC 4またはPSoC 5LP GCCコンパイラーにSoC® Creator™の数学関数の使用 – KBA93076 - Community Translated (JA)

Translation - Chinese: 如何在PSoC® Creator™中为PSoC 4或PSoC 5LP GCC编译器使用数学函数 - Community Translated (ZH)

Question: How do you use math functions in PSoC® Creator™ 3.0 for the PSoC 4 or PSoC 5LP GCC Compiler?

Answer:

To use math functions (for example, sqrt or pow) with PSoC Creator, do the following steps:

  1.   Click Project.
  2.   Click Build Settings.
  3.   Open the Linker settings under ARM GCC 4.7.3 and click General.
  4.   Under Additional Libraries, add m.

These steps are shown in Figure 1.

Figure 1. Adding the Math Library

Math library

If you do not add this additional library then you will get the build error, "undefined reference to sqrt" (where sqrt is a math function) if you try to use a math function.

Version history
Revision #:
1 of 1
Last update:
‎Mar 24, 2011 05:25 AM
Updated by:
 
Contributors