snmp.c compile time error with cactid-0.8.6f-1
Moderators: Developers, Moderators
snmp.c compile time error with cactid-0.8.6f-1
Hello,
I'm trying to compile cactid-0.8.6f-1 under RH 7.3 and getting the following error when trying to run make:
make
source='snmp.c' object='snmp.o' libtool=no \
depfile='.deps/snmp.Po' tmpdepfile='.deps/snmp.TPo' \
depmode=gcc3 /bin/sh ./config/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
snmp.c: In function `snmp_get_multi':
snmp.c:311: parse error before `int'
snmp.c:312: `count' undeclared (first use in this function)
snmp.c:312: (Each undeclared identifier is reported only once
snmp.c:312: for each function it appears in.)
make: *** [snmp.o] Error 1
Any ideas would be appreciated. Thanks.
I'm trying to compile cactid-0.8.6f-1 under RH 7.3 and getting the following error when trying to run make:
make
source='snmp.c' object='snmp.o' libtool=no \
depfile='.deps/snmp.Po' tmpdepfile='.deps/snmp.TPo' \
depmode=gcc3 /bin/sh ./config/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/include/mysql -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
snmp.c: In function `snmp_get_multi':
snmp.c:311: parse error before `int'
snmp.c:312: `count' undeclared (first use in this function)
snmp.c:312: (Each undeclared identifier is reported only once
snmp.c:312: for each function it appears in.)
make: *** [snmp.o] Error 1
Any ideas would be appreciated. Thanks.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Upgrade GCC. What version are you running?
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
I'm not very proficient with C, but I couldn't find anything obviously wrong with the syntax. Can I assume that it has something to do with where the variable is being declared?
Thanks,
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
I'm not very proficient with C, but I couldn't find anything obviously wrong with the syntax. Can I assume that it has something to do with where the variable is being declared?
Thanks,
Hi
Same problem on solaris 8:
gcc -DHAVE_CONFIG_H -I. -I. -I./config -D_POSIX_PTHREAD_SEMANTICS -I/opt/net-snmp/include/net-snmp -I/opt/net-snmp/include/net-snmp/.. -I/usr/local/mysql/include -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
snmp.c: In function `snmp_get_multi':
snmp.c:311: parse error before `int'
snmp.c:312: `count' undeclared (first use in this function)
snmp.c:312: (Each undeclared identifier is reported only once
snmp.c:312: for each function it appears in.)
make: *** [snmp.o] Error 1
#gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)
Patrick
Same problem on solaris 8:
gcc -DHAVE_CONFIG_H -I. -I. -I./config -D_POSIX_PTHREAD_SEMANTICS -I/opt/net-snmp/include/net-snmp -I/opt/net-snmp/include/net-snmp/.. -I/usr/local/mysql/include -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
snmp.c: In function `snmp_get_multi':
snmp.c:311: parse error before `int'
snmp.c:312: `count' undeclared (first use in this function)
snmp.c:312: (Each undeclared identifier is reported only once
snmp.c:312: for each function it appears in.)
make: *** [snmp.o] Error 1
#gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)
Patrick
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
See if you can upgrade gcc to 3.4...
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 25
- Joined: Sun Sep 12, 2004 1:13 pm
I suggest it's not a good idea to produce code, thich can be compiled only on gcc 3.x
I've got FreeBSD 4.11, and many people use it on production servers, and it has gcc 2.95 bundled.
There's no real advantages from those incompartibilities (variables are declared in the middle of code, not in the beginning of { } construct), so it's reasonable to keep compartibility with older versions.
If you want, I can fix code, test in on gcc 2.95, and provide a patch.
I've got FreeBSD 4.11, and many people use it on production servers, and it has gcc 2.95 bundled.
There's no real advantages from those incompartibilities (variables are declared in the middle of code, not in the beginning of { } construct), so it's reasonable to keep compartibility with older versions.
If you want, I can fix code, test in on gcc 2.95, and provide a patch.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
See if you have any better luck with this. Remember "dos2unix *.c", "dos2unix *.h"
TheWitness
TheWitness
- Attachments
-
- cactid.zip
- (48.58 KiB) Downloaded 259 times
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 25
- Joined: Sun Sep 12, 2004 1:13 pm
Here's patch
There's no significant changes, I've shifted few lines with declarations, and added few { } to satisfy gcc 2.95
I've compiled it successfully on FreeBSD 4.11
There's no significant changes, I've shifted few lines with declarations, and added few { } to satisfy gcc 2.95
I've compiled it successfully on FreeBSD 4.11
- Attachments
-
- patch.txt
- (2.67 KiB) Downloaded 269 times
-
- Posts: 25
- Joined: Sun Sep 12, 2004 1:13 pm
Actually config.h in attached file cactid.zip should be removed before compiling, since configure creates it in /config dir.bbaydar wrote:Using both of these patches I was able to get cactid to compile under RH 7.3, and gcc 2.96. I had to apply the changes in patch.txt by hand for some reason as feeding it to patch (patch -p1 < patch.txt) failed.
Thank you both very much.
And patch applies cleanly on files from cactid.zip - probably you're patching some files from older version.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Thanks for the patch!!!
Larry
Larry
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
after applying the patch i get this error
===> Building for cactid-0.8.6.f_1
source='snmp.c' object='snmp.o' libtool=no depfile='.deps/snmp.Po' tmpdepfile='.deps/snmp.TPo' depmode=gcc /usr/local/bin/bash ./config/depcomp gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -g -O2 -c `test -f 'snmp.c' || echo './'`snmp.c
In file included from snmp.c:33:
common.h:81: stdint.h: No such file or directory
In file included from snmp.c:47:
/usr/local/include/net-snmp/../net-snmp/net-snmp-includes.h:17: stdint.h: No such file or directory
*** Error code 1
Stop in /usr/ports/net/cactid/work/cacti-cactid-0.8.6f-1.
*** Error code 1
Stop in /usr/ports/net/cactid.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
All,
Please confirm that the updated files compile.
Thanks,
TheWitness
anh,
Please run the following commands from the cactid source directory:
aclocal
autoheader
autoconf
automake
make
Please confirm that the updated files compile.
Thanks,
TheWitness
anh,
Please run the following commands from the cactid source directory:
aclocal
autoheader
autoconf
automake
make
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Oops,
Forgot to attache the files.
TheWitness
Forgot to attache the files.
TheWitness
- Attachments
-
- old-gcc-fix.tar.gz
- (13.41 KiB) Downloaded 274 times
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 0 guests