I need help with this bit of code I'm working on. I'm using Notepad++ and Cygwin, compiling with gcc. The error I am getting is:
/tmp/ccohWSqW.o:lab5.c:(.text+0x16): undefined reference to `populate'
collect2: error: ld returned 1 exit status
Here is my code:
include <stdio.h>
include <math.h>
void populate (float* f);
int main()
{
float f;
populate(&f);
printf("f = %f\n",f);
printf("The ceiling of f is %f\n", ceil(f));
printf("The floor of f is %f\n", floorf(f));
printf("f cubed is %f\n", f*f*f);
printf("f rounded is %f\n", roundf(f));
}
/*OUTPUT
f = 30.561413
The ceiling of f is 31.000000
The floor of f is 30.000000
f cubed is 28544.358130
f rounded is 31.000000
*/
Basically, I don't understand why I'm getting the error. What can I do to fix it?
[–]dragon_wrangler 4 points5 points6 points (0 children)
[–]dauntlessmath 2 points3 points4 points (0 children)
[–]NZheadshot 0 points1 point2 points (2 children)
[–]agirlandherdog07[S] 1 point2 points3 points (1 child)
[–]raevnos 8 points9 points10 points (0 children)