You are here

Using Math Functions in PSoC Creator for PSoC5's GCC Compiler | Cypress Semiconductor

Using Math Functions in PSoC Creator for PSoC5's GCC Compiler

Summary: 5 Replies, Latest post by rajendermehta on 28 Jun 2015 08:35 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
dasg's picture
Cypress Employee
730 posts

Hi All,


There have been many contestants who have faced difficulty while using math functions in PSoC Creator using PSoC5's GCC Compiler even after including the 'math.h' header file.

Please undertake the following to eliminate the Build error:

Goto Project > Build Settings > Linker > General > Additional Libraries. Now type m in the Additional Libraries field.

Now, after the project Builds without any math error.

Refer to the KB article at the following link:




yliu's picture
Cypress Employee
37 posts

If I want to include other libraries, do I have to use another letter?

vairavelavan's picture
1 post

Hi all

I would like to know, is there trigonometric function viz Sin,Cos, Tan etc in Math.h or any other library of PSOC5?


Have we to create new header file for the trigonometric function?

Referring the below link referring the same but last update was in 2008.

This may help me to proceed for my purchase of PSOC5 kit from other delevelopment kit.

Thank you

user_14586677's picture
7646 posts

I am taking lazy appoach to answer, but make a quick sample testbench project,

do a library call, and see if it works. The beauty of our tools today is ability to

self test ideas quickly in a GUI environment.


Regards, Dana.

user_1377889's picture
9301 posts

I already used atan, sin etc, they (of course) work as expected. Just #include math.h


rajendermehta's picture
23 posts

 Use "-lm" as linker command line option.

Log in to post new comments.