I am trying to run make on a PintOS makefile but I keep getting the undefined reference to `floor’ error. The makefile is below. I am running Ubuntu 11.10 with gcc 4.6.1. Any help is appreciated.
all: setitimer-helper squish-pty squish-unix
CC = gcc
CFLAGS = -Wall -W
LDFLAGS = -lm
setitimer-helper: setitimer-helper.o
squish-pty: squish-pty.o
squish-unix: squish-unix.o
clean:
rm -f *.o setitimer-helper squish-pty squish-unix
~
-lmshould be inLDLIBS, notLDFLAGS.The difference is important, because the implicit rule for linking executables is:
and
ld(invoked by GCC) has a strict left-to-right dependency-resolution algorithm.