我试图在PintOS makefile上运行make,但我一直得到未定义的引用"floor"错误.makefile在下面.我用gcc 4.6.1运行Ubuntu 11.10.任何帮助表示赞赏.
    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
〜
-lm应该在LDLIBS,而不是LDFLAGS.
区别很重要,因为链接可执行文件的隐式规则是:
$(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)
和ld(GCC所调用的)有严格的左到右依赖解析算法.
| 归档时间: | 
 | 
| 查看次数: | 2393 次 | 
| 最近记录: |