Re: Compilation error (MIB)

Pranesh Kulkarni <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
itz just "C" error

I think ur using FILE *fp  and using fp for fp = popen(  ) ,
But some where you have decleared as fp ..
 for this only  these errors are coming
  ciscoDmpMIBHdmi.c:18: error: conflicting types for 'fp'
ciscoDmpMIBHdmi.c:16: error: previous declaration of 'fp' was here

 just check the code once again,

On Tue, Jan 27, 2009 at 6:38 AM, Mitul Sen (misen) <[email protected]> wrote:

>
> Hello,
>
> I have defined a MIB and the generated the C code for the managed object
> using mib2c. Once I added the implementation (I am simply using popen() to
> issue a command and I am trying to get the output of this command and pass
> it to the snmp_set_var_typed_value(..) function). However, my code doesn't
> seem to compile. I can however compile the same code (the lines that give
> the compilation error) on my linux machine as a standalone program (without
> net-snmp)
>
> I have attached the code I am using. The compilation error is as follows
>
> make[2]: Entering directory
> `/home/misen/work/snmp/net-snmp-5.4.2.1/agent/mibgroup'
> /bin/sh ../../libtool  --mode=compile gcc -I../../include -I. -I../../agent
> -I../../agent/mibgroup -I../../snmplib   -g -O2 -Ulinux -Dlinux=linux
> -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing
> -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -I/usr/lib/perl/5.8/CORE   -c -o ciscoDmpMIBHdmi.lo ciscoDmpMIBHdmi.c
>  gcc -I../../include -I. -I../../agent -I../../agent/mibgroup
> -I../../snmplib -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE
> -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -c
> ciscoDmpMIBHdmi.c  -fPIC -DPIC -o .libs/ciscoDmpMIBHdmi.o
> ciscoDmpMIBHdmi.c:18: warning: data definition has no type or storage class
> ciscoDmpMIBHdmi.c:18: error: conflicting types for 'fp'
> ciscoDmpMIBHdmi.c:16: error: previous declaration of 'fp' was here
> ciscoDmpMIBHdmi.c:18: warning: initialization makes integer from pointer
> without a cast
> ciscoDmpMIBHdmi.c:18: error: initializer element is not constant
> ciscoDmpMIBHdmi.c:20: error: expected identifier or '(' before 'if'
> make[2]: *** [ciscoDmpMIBHdmi.lo] Error 1
> make[2]: Leaving directory
> `/home/misen/work/snmp/net-snmp-5.4.2.1/agent/mibgroup'
> make[1]: *** [subdirs] Error 1
> make[1]: Leaving directory `/home/misen/work/snmp/net-snmp-5.4.2.1/agent'
> make: *** [subdirs] Error 1
>
>
>
>
> Not sure what I am doing wrong. Any help will be much appreciated.
>
> Thanks and regards,
> Mitul
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> 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
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.