Hello Magnus,
Actually I'm using the Debian package *libsnmp-dev* (v5.4.2.1), and here's
the requested instruction:
*$ net-snmp-config --configure-options*
'--build=i486-linux-gnu' '--includedir=/usr/include'
'--mandir=/usr/share/man' '--infodir=/usr/share/info' '--localstatedir=/var'
'--libexecdir=/usr/lib/net-snmp' '--disable-maintainer-mode'
'--disable-dependency-tracking' '--prefix=/usr' '--sysconfdir=/etc'
'--mandir=/usr/share/man' '--with-persistent-directory=/var/lib/snmp'
'--enable-ucd-snmp-compatibility' '--enable-shared' '--with-cflags=-g -O2
-DNETSNMP_USE_INLINE' '--with-perl-modules=INSTALLDIRS=vendor'
'--enable-as-needed' '--enable-ipv6' '--with-logfile=none' '--without-rpm'
'--with-libwrap' '--with-openssl' '--without-dmalloc' '--without-efence'
'--without-rsaref' '--with-sys-contact=root' '--with-sys-location=Unknown'
'--with-mib-modules=host smux ucd-snmp/dlmod ucd-snmp/diskio
ucd-snmp/lmSensors ' '--enable-mfd-rewrites' '--with-mnttab=/etc/mtab'
'--with-defaults' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2'
'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='
Thanks,
--
Rodrigo Hjort
www.hjort.co
2011/9/30 Magnus Fromreide
> On Thu, 2011-09-29 at 23:52 -0400, Rodrigo Hjort wrote:
> > Hello coders,
> >
> > I'm trying to compile a custom SNMP subagent with caching
> > capabilities, but I'm facing this issue:
> >
> > rodrigo@zangaro:~/cache$ make
> > gcc -I. `net-snmp-config --cflags` -c -o example-demon.o
> > example-demon.c
> > gcc -I. `net-snmp-config --cflags` -c -o pgstatDatabaseTable.o
> > pgstatDatabaseTable.c
> > gcc -o example-demon example-demon.o pgstatDatabaseTable.o
> > `net-snmp-config --agent-libs`
> > pgstatDatabaseTable.o: In function
> > `initialize_table_pgstatDatabaseTable':
> > /home/rodrigo/cache/pgstatDatabaseTable.c:160: undefined reference to
> > `netsnmp_cache_free'
> > /home/rodrigo/cache/pgstatDatabaseTable.c:164: undefined reference to
> > `netsnmp_table_registration_info_free'
> > collect2: ld returned 1 exit status
> > make: *** [example-demon] Erreur 1
> >
> > The source code can be fetched from here:
> > https://github.com/hjort/pgstatmib/tree/master/labs/cache
> >
> > More info:
> >
> > $ net-snmp-config --cflags
> > -DNETSNMP_ENABLE_IPV6 -g -O2 -DNETSNMP_USE_INLINE -Ulinux
> > -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing
> > -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
> > -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE -I. -I/usr/include
> >
> > $ net-snmp-config --agent-libs
> > -Wl,-Bsymbolic-functions -L/usr/lib -lnetsnmpagent -lnetsnmphelpers
> > -lnetsnmpmibs -lnetsnmp -Wl,-E
> >
> > $ ls -1 /usr/lib/libnetsnmp*.la
> > /usr/lib/libnetsnmpagent.la
> > /usr/lib/libnetsnmphelpers.la
> > /usr/lib/libnetsnmp.la
> > /usr/lib/libnetsnmpmibs.la
> > /usr/lib/libnetsnmptrapd.la
> >
> > Does anyone have a clue on how to solve this?
>
>
> Could you please provide the output of
>
> net-snmp-config --configure-options
>
> I suspect that you have configured with --enable-minimalist and without
> enough --with-features.
>
> /MF
>
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders