RE: Question about mib2c.create-dataset.conf
X Z <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I didn't change anything but I am still getting the same error: myTable.c:117: error: conflicting types for myTable_free myTable.h:16: error: previous declaration of myTable_free was here I did include the following headers: #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> and in Makefile, I linked to -lnetsnmplibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp Did I miss anything? Why the compiler complained the different type difinitions? Thanks Xuan > Date: Tue, 10 Nov 2009 08:48:32 +0000 > Subject: Re: Question about mib2c.create-dataset.conf > From: [email protected] > To: [email protected] > CC: [email protected] > > 2009/11/9 X Z <[email protected]>: > > 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 _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ ------------------------------------------------------------------------------ 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 [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users