math.h will not load

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

cross mob
lock attach
Attachments are accessible only for community members.
IaCa_4674211
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

Following the directions for using the math.h library, (using PSoC 4200DS) and adding #include <math.h> to the "main.c" file and the project "generated source" project name .c , I go through the clean and build; the #include <math.h> header disapears and get the error message "incompatible implicit declaration of built-in function 'pow',

and implicit declaration of function 'pow' [-Wimplicit-function-declaration],

does anyone have an answer?

Kind regards

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Right click on your project > Build Settings > Linker > Additional Libraries and add "m" there. I think you missed adding this. You can get more information on this in the KBA here: Using Math Functions in PSoC® Creator™ for the PSoC 4 or PSoC 5LP GCC Compiler – KBA93076

Let me know your observations

Regards,
Dheeraj

View solution in original post

0 Likes
3 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Right click on your project > Build Settings > Linker > Additional Libraries and add "m" there. I think you missed adding this. You can get more information on this in the KBA here: Using Math Functions in PSoC® Creator™ for the PSoC 4 or PSoC 5LP GCC Compiler – KBA93076

Let me know your observations

Regards,
Dheeraj

0 Likes

Hi Dheeraj, Yes, I did add the m to the linker library already, do I require Keil to be activated to perform this action?

0 Likes

Note that if you make changes to the files in the Generated Source folder, you cannot do a Clean and Build. It is going to overwrite your changes. in the build settings, you can set the Skip Code Generation option to True to suppress the files in the Generated Source from being overwritten as shown in the image below:

pastedImage_1.png

Can you please let me know why you are editing the Generated Source files? What is your requirement?

Regards,

Dheeraj

0 Likes