pow() function does not work in Eclipse EZ USB suite for fx3 project

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

cross mob
dach_3214351
Level 1
Level 1
5 sign-ins 5 replies posted 5 questions asked

Hi All,

I want to use pow() function to calcuate value. but compile is faild

code\USBBulkLoopAuto\Debug/../dsplib.c:81: undefined reference to `pow'

How can i  fix this proble ?

Thanks,

Darren

1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please include math.h at the beginning of the source file where you want to use pow() function. The code for the same is given below:

#include "math.h"

After this is done, please do the following steps:

1. Open project properties. This can be done by right clicking on the project (in the project explorer) and then choosing properties.

2. Under C/C++ build, select Settings.

3. Under Cross ARM C Linker, select Libraries. The snapshot of the default libraries is shown below:

pastedImage_0.png

4. Add a new library (m) to the set of default libraries present. The snapshot of adding the new library is shown below:

pastedImage_1.png

Once this is done, hit OK and the new library will be added to the default libraries used for the project. Please find the snapshot below with the new library added to the default libraries.

pastedImage_2.png

Now press OK. Then refresh the project and try building it again. I used the same steps and could successfully build the project at my end and find powers. Please let me know if you face any issues at your end.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please include math.h at the beginning of the source file where you want to use pow() function. The code for the same is given below:

#include "math.h"

After this is done, please do the following steps:

1. Open project properties. This can be done by right clicking on the project (in the project explorer) and then choosing properties.

2. Under C/C++ build, select Settings.

3. Under Cross ARM C Linker, select Libraries. The snapshot of the default libraries is shown below:

pastedImage_0.png

4. Add a new library (m) to the set of default libraries present. The snapshot of adding the new library is shown below:

pastedImage_1.png

Once this is done, hit OK and the new library will be added to the default libraries used for the project. Please find the snapshot below with the new library added to the default libraries.

pastedImage_2.png

Now press OK. Then refresh the project and try building it again. I used the same steps and could successfully build the project at my end and find powers. Please let me know if you face any issues at your end.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna