日期:2014-05-16  浏览次数:20801 次

net-snmp的问题
从网上下的简单的程序,make不了.
Makefile:
CC=gcc

OBJS1=snmpdemoapp.o
OBJS2=example-demon.o   nstAgentSubagentObject.o
OBJS3=asyncapp.o
TARGETS=example-demon   snmpdemoapp   asyncapp

CFLAGS=-I.   `net-snmp-config   --cflags`
BUILDLIBS=`net-snmp-config   --libs`
BUILDAGENTLIBS=`net-snmp-config   --agent-libs`

#   shared   library   flags   (assumes   gcc)
DLFLAGS=-fPIC   -shared

all:   $(TARGETS)

snmpdemoapp:   $(OBJS1)
$(CC)   -o   snmpdemoapp   $(OBJS1)   $(BUILDLIBS)

asyncapp:   $(OBJS3)
$(CC)   -o   asyncapp   $(OBJS3)   $(BUILDLIBS)

example-demon:   $(OBJS2)
$(CC)   -o   example-demon   $(OBJS2)     $(BUILDAGENTLIBS)

clean:
rm   $(OBJS2)   $(OBJS2)   $(TARGETS)

nstAgentPluginObject.so:   nstAgentPluginObject.c   Makefile
$(CC)   $(CFLAGS)   $(DLFLAGS)   -c   -o   nstAgentPluginObject.o   nstAgentPluginObject.c
$(CC)   $(CFLAGS)   $(DLFLAGS)   -o   nstAgentPluginObject.so   nstAgentPluginObject.o


出错:make:   ***   No   rule   to   make   target   `example-demon.o ',   needed   by   `example-demon '.
Stop.

刚刚接触net-snmp,有点晕,就是net-snmp.org上下的哪个.
example-demon.c在哪?

------解决方案--------------------
makefile有问题, .o文件的依赖没有, 你没有编译.c文件