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

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

Moderators: Moderators, Developers

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

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

#1 Post by bbaydar » Wed Oct 12, 2005 3:02 pm

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: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#2 Post by TheWitness » Wed Oct 12, 2005 7:01 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#3 Post by bbaydar » Thu Oct 13, 2005 6:30 am

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

#4 Post by pfouquet » Thu Oct 13, 2005 7:55 am

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: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#5 Post by TheWitness » Thu Oct 13, 2005 8:53 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

#6 Post by Basilio Cat » Wed Nov 09, 2005 6:26 am

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: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#7 Post by TheWitness » Wed Nov 09, 2005 6:29 am

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

TheWitness
Attachments
cactid.zip
(48.58 KiB) Downloaded 237 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

#8 Post by Basilio Cat » Wed Nov 09, 2005 8:28 am

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 249 times

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

#9 Post by bbaydar » Wed Nov 09, 2005 9:14 am

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

#10 Post by Basilio Cat » Wed Nov 09, 2005 9:27 am

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

#11 Post by anh » Wed Nov 09, 2005 10:02 am

How do i apply the patch.txt ?

User avatar
TheWitness
Developer
Posts: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#12 Post by TheWitness » Wed Nov 09, 2005 12:06 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

#13 Post by anh » Wed Nov 09, 2005 3:08 pm

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: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#14 Post by TheWitness » Wed Nov 09, 2005 8:36 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
TheWitness
Developer
Posts: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#15 Post by TheWitness » Wed Nov 09, 2005 8:38 pm

Oops,

Forgot to attache the files.

TheWitness
Attachments
old-gcc-fix.tar.gz
(13.41 KiB) Downloaded 251 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Post Reply