Getting undefined reference to "gender" for PintOS make

I'm trying to run make on a PintOS makefile, but I keep getting undefined reference to the "floor" error. The make file 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

      

~

+3


source to share


1 answer


-lm

should be in LDLIBS

, not LDFLAGS

.

The difference is important because the implicit rule for linking executables is:



$(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)

      

and ld

(called by GCC) has a strict left-to-right dependency resolution algorithm.

+8


source







All Articles