cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
445 Views
Registered: ‎04-18-2019

How to build Petalinux with Pow(x,y) function?

Greetings,

 

I follow Zynq-7000 AP SoC Low Power Techniques part 4 - Measuring ZC702 Power with Linux Appl. and created Petalinux C Application to run on user space. I try to build petalinux with petalinux-build command and I got the error " undefined reference to 'pow' ". petalinux-build command does not recognize pow(x,y) function  to compile C source code which is taken from the Low Power Techniques part 4 mentioned above.

The line where I got error : 

" current = mantissa * pow(2.0, exponent); "


Could anyone please help me to solve this problem?

 

Best Regards,

Ömer 

0 Kudos
2 Replies
Highlighted
Scholar
Scholar
420 Views
Registered: ‎05-28-2013

Some things to check:

  • have you added #include <math.h>
  • are you linking with the math library -lm

Reference: SYNOPSIS section of http://man7.org/linux/man-pages/man3/pow.3.html

0 Kudos
Highlighted
Moderator
Moderator
411 Views
Registered: ‎09-12-2007

Right click on your applciation, and select C/C++ Build Settings:

math.PNG

0 Kudos