Hi!

I'm trying to compile and test the agent coding example according to the 
tutorial step by 
step(http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/mfd/if-mib/ifTable/index.html),
 but ran into errors while compiling. I recorded what I did as below, would you 
please help me find what I've missed?

1. make a new dir named iftable, run 'mib2c -c mib2c.mfd.conf ifTable', 'mib2c 
-c mfd-makefile.m2m ifTable', 'mib2c -c subagent.m2c ifTable' seperately, and 
several files generated:

drwxr-xr-x 2 xray xray  4096 2008-08-20 16:39 defaults
-rw-r--r-- 1 xray xray  5815 2008-08-20 11:28 ifTable.c
-rw-r--r-- 1 xray xray  5584 2008-08-20 11:28 ifTable.c~
-rw-r--r-- 1 xray xray 22910 2008-08-20 11:28 ifTable_data_access.c
-rw-r--r-- 1 xray xray 21961 2008-08-20 11:28 ifTable_data_access.c~
-rw-r--r-- 1 xray xray  2859 2008-08-20 11:28 ifTable_data_access.h
-rw-r--r-- 1 xray xray  2382 2008-08-20 11:28 ifTable_data_access.h~
-rw-r--r-- 1 xray xray 54964 2008-08-20 11:28 ifTable_data_get.c
-rw-r--r-- 1 xray xray 53403 2008-08-20 11:28 ifTable_data_get.c~
-rw-r--r-- 1 xray xray  4577 2008-08-20 11:28 ifTable_data_get.h
-rw-r--r-- 1 xray xray  3192 2008-08-20 11:28 ifTable_data_get.h~
-rw-r--r-- 1 xray xray 34404 2008-08-20 16:04 ifTable_data_get.o
-rw-r--r-- 1 xray xray 18562 2008-08-20 11:28 ifTable_data_set.c
-rw-r--r-- 1 xray xray 18073 2008-08-20 11:28 ifTable_data_set.c~
-rw-r--r-- 1 xray xray 12191 2008-08-20 11:28 ifTable_data_set.h
-rw-r--r-- 1 xray xray  7437 2008-08-20 11:28 ifTable_data_set.h~
-rw-r--r-- 1 xray xray 16312 2008-08-20 16:04 ifTable_data_set.o
-rw-r--r-- 1 xray xray 10207 2008-08-20 11:28 ifTable_enums.h
-rw-r--r-- 1 xray xray 10292 2008-08-20 11:28 ifTable_enums.h~
-rw-r--r-- 1 xray xray  9321 2008-08-20 11:28 ifTable.h
-rw-r--r-- 1 xray xray  8342 2008-08-20 11:28 ifTable.h~
-rw-r--r-- 1 xray xray 79335 2008-08-20 11:28 ifTable_interface.c
-rw-r--r-- 1 xray xray 76021 2008-08-20 11:28 ifTable_interface.c~
-rw-r--r-- 1 xray xray  3893 2008-08-20 11:28 ifTable_interface.h
-rw-r--r-- 1 xray xray  3326 2008-08-20 11:28 ifTable_interface.h~
-rw-r--r-- 1 xray xray  1088 2008-08-20 16:11 ifTable_Makefile
-rw-r--r-- 1 xray xray  1594 2008-08-20 11:28 ifTable_oids.h
-rw-r--r-- 1 xray xray  1636 2008-08-20 11:28 ifTable_oids.h~
-rw-r--r-- 1 xray xray  6455 2008-08-20 11:28 ifTable-README-FIRST.txt
-rw-r--r-- 1 xray xray 46924 2008-08-20 11:28 ifTable-README-ifTable.txt
-rw-r--r-- 1 xray xray  5850 2008-08-20 11:32 ifTable_subagent.c
-rw-r--r-- 1 xray xray  5124 2008-08-20 11:32 ifTable_subagent.c~

2. make, but errors reported(my os env is chinese, and the error message means 
that the viriables are not declared):

[EMAIL PROTECTED]:~/workspace/iftable$ make -f ifTable_Makefile
gcc -I. `net-snmp-config --base-cflags` -Wall -Wstrict-prototypes   -c -o 
ifTable_data_access.o ifTable_data_access.c
ifTable_data_access.c: 在函数 ‘ifTable_container_load’ 中:
ifTable_data_access.c:321: 错误: ‘ifDescr_len’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:321: 错误: (即使在一个函数内多次出现,每个未声明的标识符在其
ifTable_data_access.c:321: 错误: 所在的函数内只报告一次。)
ifTable_data_access.c:321: 错误: ‘ifDescr’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:334: 错误: ‘ifType’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:341: 错误: ‘ifMtu’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:348: 错误: ‘ifSpeed’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:360: 错误: ‘ifPhysAddress_len’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:360: 错误: ‘ifPhysAddress’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:374: 错误: ‘ifAdminStatus’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:381: 错误: ‘ifOperStatus’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:388: 错误: ‘ifLastChange’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:395: 错误: ‘ifInOctets’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:402: 错误: ‘ifInUcastPkts’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:409: 错误: ‘ifInNUcastPkts’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:416: 错误: ‘ifInDiscards’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:423: 错误: ‘ifInErrors’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:430: 错误: ‘ifInUnknownProtos’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:437: 错误: ‘ifOutOctets’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:444: 错误: ‘ifOutUcastPkts’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:451: 错误: ‘ifOutNUcastPkts’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:458: 错误: ‘ifOutDiscards’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:465: 错误: ‘ifOutErrors’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:472: 错误: ‘ifOutQLen’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:484: 错误: ‘ifSpecific_len’ 未声明 (在此函数内第一次使用)
ifTable_data_access.c:484: 错误: ‘ifSpecific’ 未声明 (在此函数内第一次使用)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to