UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
257 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
Scholar rfs613
Scholar
232 Views
Registered: ‎05-28-2013

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

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
Moderator
Moderator
223 Views
Registered: ‎09-12-2007

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

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

math.PNG

0 Kudos