Depends on what OS. If its linux (or some other unix), the manpages for the function should tell you. If its something else (e.g. mac, windows, etc), I dont know. But for all the math functions, use -lm