Lesson KB 05: Using Math Function in PSoC Creator for GCC CompilerKBA93076

If you need to use math functions in PSoC Creator 3.x (or later version) for the PSoC 5LP project by using GCC Compiler, you have to add the math library into your project. If you do not add the math library then you will get the build error "Undefined reference to xxx" (where xxx is a math function).

The following steps show how to add math library to your project.

  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: