LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What happened to "round" and "pow" functions? (https://www.linuxquestions.org/questions/programming-9/what-happened-to-round-and-pow-functions-866825/)

worsel 03-06-2011 04:26 PM

What happened to "round" and "pow" functions?
 
About eleven years ago I wrote several small financial programs in C.
Today I went to modify them. When I tried to compile, I got the
messages "Undefined reference to 'pow'" and "Undefined reference to 'round'".

According to the manual, these are defined in math.h. Couldn't find them there
and searches through /usr/include were indefinite at best.

Using gcc-4.4.

TIA, John

Nominal Animal 03-06-2011 04:39 PM

Did you remember to link against the math library, i.e. use -lm linker option?

corp769 03-06-2011 04:41 PM

Try using the -lm linker flag when you compile it.

Cheers,

Josh

worsel 03-06-2011 10:19 PM

Thanks. The problem was not using C for too many years.

John

corp769 03-07-2011 09:46 AM

Operater error, huh? :D


All times are GMT -5. The time now is 05:34 PM.