snmp.c compile time error with cactid-0.8.6f-1

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

bbaydar
Posts: 4
Joined: Wed Oct 12, 2005 2:57 pm

snmp.c compile time error with cactid-0.8.6f-1

Post by bbaydar »

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.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Upgrade GCC. What version are you running?

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?
bbaydar
Posts: 4
Joined: Wed Oct 12, 2005 2:57 pm

Post by bbaydar »

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,
pfouquet
Posts: 7
Joined: Mon Jan 10, 2005 6:32 am

Post by pfouquet »

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
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

See if you can upgrade gcc to 3.4...

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?
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

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.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

See if you have any better luck with this. Remember "dos2unix *.c", "dos2unix *.h"

TheWitness
Attachments
cactid.zip
(48.58 KiB) Downloaded 265 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?
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

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
Attachments
patch.txt
(2.67 KiB) Downloaded 281 times
bbaydar
Posts: 4
Joined: Wed Oct 12, 2005 2:57 pm

Post by bbaydar »

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.
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

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.
Actually config.h in attached file cactid.zip should be removed before compiling, since configure creates it in /config dir.
And patch applies cleanly on files from cactid.zip - probably you're patching some files from older version.
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

How do i apply the patch.txt ?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Thanks for the patch!!!

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?
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

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.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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
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?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Oops,

Forgot to attache the files.

TheWitness
Attachments
old-gcc-fix.tar.gz
(13.41 KiB) Downloaded 280 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests