Go to Build
-> Set Build Commands
then under C commands
click on the empty label and it will let you specify a new label (name it Link
). Type in it gcc -Wall -o "%e" "%f" -lm
- where -lm
will tell it to link the math
library to your app. Click OK
.
Then click on Build
and select your newly created label - Link
. This should do it for you.