2009/11/9 X Z <b...@live.com>:
> I use mib2c.create-dataset.conf to generate codes for a table, but I got the
> following error:
> conflicting types for myTable_free and myTable_load. I use the cache method,
> it creates the following codes in the header file:
>
> NetsnmpCacheLoad myTable_load;
> NetsnmpCacheFree myTable_free;

Yes


> But in c file, the function type is as follows:
> int myTable_load(netsnmp_cache * cache, void *vmagic)
> int myTable_free(netsnmp_cache * cache, void *vmagic)

Yes.


> I tried to change all int type, it didn't work. I tried to change the int
> type to  NetsnmpCacheLoad or NetsnmpCacheFree, it gave me errors:
> error: myTable_load declared as function returning a function
>
> Any insight on how to make it working?

Don't change anything - use the code as originally generated.

If you had checked the definition of "NetsnmpCacheLoad"
or "NetsnmpCacheFree" (in <net-snmp/agent/cache_handler.h>)
you would see that these two function types do indeed expect
parameters of  cache*/void*  - just as the generated code does.

   The generated code isn't broken - don't try to fix it.


(Strictly speaking, the myTable_free routine should actually return
void, not int.  But that shouldn't be a major problem)


Dave

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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