You don't have problems with snmp-lib, but with basic codings: you don't 
have main() defined at all (certainly if this is all your code!).
Or if you have this as a module, you have to compile it with "-c" option, 
see gcc manual for details on options.

Tomas


On Wed, 12 May 2010, Alexander Shikoff wrote:

> Hello,
> I started to learn C API of net-snmp package, and I have a problem with
> compiling simple application on FreeBSD 7.2 with net-snmp 5.4.2:
>
> # cc -O2 -fno-strict-aliasing -pipe -march=athlon-mp -g -I/usr/local/include 
> -I. -L /usr/local/lib -o mib.o -lnetsnmp mib.c
> /usr/lib/crt1.o(.text+0x7b): In function `_start':
> : undefined reference to `main'
>
> The listing of application:
> #include <stdio.h>
> #include <net-snmp/net-snmp-config.h>
> #include <net-snmp/net-snmp-includes.h>
> #include "simond.h"
>
> /* Function loads MIB from file with filename fn */
> void
> mib_load (char *fn) {
>        char *dirs;
>
>        dirs = netsnmp_get_mib_directory();
>
>        printf("Directories: %s\n", dirs);
> }
>
> Any help will be kindly appreciated! Thanks.
>
> -- 
> MINO-RIPE
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>

------------------------------------------------------------------------------

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to