Hi, >I need to prototype a stand-alone C application that uses the Net-SNMP >library functions to send a SNMPv1 trap (e.g. coldStart). I have had >very little success and I am looking for help. I am writing this >application on a RedHat Linux platform.
I suggest looking at the code of the snmptrap-utility, it helped me a lot! >-----> BEGIN CODE: makefile <----- >CC=gcc >TARGETS=send_trap agent >TOBJ=send_trap.o >AOBJ=agent.o > >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 > >send_trap: $(TOBJ) > $(CC) -o send_trap $(TOBJ) $(BUILDLIBS) > >clean: > rm $(TOBJ) $(AOBJ) $(TARGETS) >-----> END CODE <----- The Makefile is OK but there seem to be some unnecessary things in it: "agent" in the TARGETS-list complete "AOBJ" line complete "BUILDAGENTLIBS" line complete "shared library" section "$(AOBJ)" statement in "rm" command of clean-target >gcc -I. `net-snmp-config --cflags` -c -o send_trap.o send_trap.c >gcc -o send_trap send_trap.o `net-snmp-config --libs` >/usr/bin/ld: skipping incompatible libnetsnmp.so when searching for >-lnetsnmp >/usr/bin/ld: skipping incompatible libnetsnmp.a when searching for >-lnetsnmp It looks like you have some sort of incompatible version of the netsnmp-library in your system (different architecture?), does send_trap link and work? If so you also have a usable version on your HD and things should be fine but I´d search for that "incompatible" version... regards Wolfgang ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
