# pow with variable throws error

**URL:** https://discourse.cmake.org/t/pow-with-variable-throws-error/1893
**Category:** Usage
**Tags:** os:linux
**Created:** [September 22, 2020, 6:33pm UTC](https://discourse.cmake.org/t/pow-with-variable-throws-error/1893 "2020-09-22T18:33:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![grenmel](https://discourse.cmake.org/user_avatar/discourse.cmake.org/grenmel/32/847_2.png) [@grenmel](https://discourse.cmake.org/u/grenmel)
#### Post date: [September 22, 2020, 6:33pm UTC](https://discourse.cmake.org/t/pow-with-variable-throws-error/1893/1 "2020-09-22T18:33:21Z")

</div>

Hi, I’m new to C. When I try variable in pow function (for example pow(hightSq,2)) it returns "undefined reference to ‘pow’ ". I’ve read that it has to do something with UNIX compatibility and that you have to add arguments to compiler but whatever I add there it just wont work.

Thank you for any help with problem.

---

<div class="post-metadata">

### Author: ![Dakon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dakon/32/854_2.png) [@Dakon](https://discourse.cmake.org/u/Dakon)
#### Post date: [September 27, 2020, 7:47pm UTC](https://discourse.cmake.org/t/pow-with-variable-throws-error/1893/2 "2020-09-27T19:47:04Z")

</div>

target\_link\_libraries(myprogram m)
