在PintOS上运行make时获取未定义的“floor”参考 [英] Getting undefined reference to `floor' on running make in PintOS
本文介绍了在PintOS上运行make时获取未定义的“floor”参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在PintOS makefile上运行make,但是我一直收到未定义的对'floor'错误的引用。下面是makefile。我使用gcc 4.6.1运行Ubuntu 11.10。任何帮助表示赞赏。
全部: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)no $ (LOADLIBES)$(LDLIBS)
和 ld
(由GCC调用)具有严格的从左到右的依赖关系解析算法。
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
~
解决方案
-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
(invoked by GCC) has a strict left-to-right dependency-resolution algorithm.
这篇关于在PintOS上运行make时获取未定义的“floor”参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文