I'm having issues with the GCC linker, specifically using the -lm
flag since I'm using some functions from math.h. I get the following errors:
main.c:(.text+0x8e5): undefined reference to `floor'
main.c:(.text+0x901): undefined reference to `ceil'
Here's the relevant portion of my makefile:
myprogram: main.o
gcc -Wall -pedantic -o myprogram main.o
main.o: main.c foo.h bar.h
gcc -Wall -pedantic -lm main.c
Probably something silly I'm overlooking, but I'm definitely not an expert when it comes to makefiles.