我看KDE2编程宝典,在shell刚写了个helloworld程序,makefile文件如下:
INCL=-I$(QTDIR)/include -I$(KDEDIR)/include
CFLAGS= -pipe -02 -fno-strength-reduce
LFLAGS= -L$(QTDIR)/lib -L$(KDEDIR)/lib -L/usr/X11R6/lib
LIBS= -lqt -lX11 -lXext
CC=g++
helloworld:helloworld.o
$(CC) $(LFLAGS) -o helloworld helloworld.o $(LIBS)
helloworld.o:helloworld.cpp
clean:
rm -f helloworld
rm -f helloworld.o
.SUFFIXES: .cpp
.cpp.o:
$(CC) -c $(CFLAGS) $(INCL) -o $@ $
结果:
>make
>helloworld.o -lqt -lX11 -lXext
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot find -lqt
>collect2: ld returned 1 exit status
>make: *** [helloworld] Error 1
大家看看是什么原因?