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

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

Post by Basilio Cat »

anh wrote: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.
Remove config.h in main directory, but leave it in /config (configure script creates it there).

Or (which is better) overwrite only patched files from attachment in previous message - old-gcc-fix.tar.gz
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

Still getting an error
su-2.05b# aclocal15
su-2.05b# autoheader259
configure.ac:13: warning: do not use m4_patsubst: use patsubst or m4_bpatsubst
aclocal.m4:546: AM_CONFIG_HEADER is expanded from...
configure.ac:13: the top level
configure.ac:202: warning: do not use m4_regexp: use regexp or m4_bregexp
aclocal.m4:559: _AM_DIRNAME is expanded from...
configure.ac:202: the top level
su-2.05b# autoconf259
configure.ac:13: warning: do not use m4_patsubst: use patsubst or m4_bpatsubst
aclocal.m4:546: AM_CONFIG_HEADER is expanded from...
configure.ac:13: the top level
configure.ac:202: warning: do not use m4_regexp: use regexp or m4_bregexp
aclocal.m4:559: _AM_DIRNAME is expanded from...
configure.ac:202: the top level
su-2.05b# automake15
automake15: Makefile.am: required file `./ChangeLog' not found
su-2.05b# make
"Makefile", line 201: Could not find .deps/cactid.Po
"Makefile", line 202: Could not find .deps/locks.Po
"Makefile", line 203: Could not find .deps/nft_popen.Po
"Makefile", line 204: Could not find .deps/php.Po
"Makefile", line 205: Could not find .deps/ping.Po
"Makefile", line 206: Could not find .deps/poller.Po
"Makefile", line 207: Could not find .deps/snmp.Po
"Makefile", line 208: Could not find .deps/sql.Po
"Makefile", line 209: Could not find .deps/util.Po
make: fatal errors encountered -- cannot continue
su-2.05b# ./configure
checking build system type... i386-unknown-freebsd4.11
checking host system type... i386-unknown-freebsd4.11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) nawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
checking whether to enable -Wall... no
checking for kstat_lookup in -lkstat... no
checking for gethostbyname in -lnsl... no
checking for socket in -lsocket... no
checking for floor in -lm... yes
checking for pthread_exit in -lpthread... no
checking for deflate in -lz... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for unsigned long long... yes
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking for gettimeofday... yes
checking for strerror... yes
checking for strtoll... yes
checking for mysql_init in -lmysqlclient... yes
checking for mysql_thread_init in -lmysqlclient... yes
checking if UCD-SNMP needs crypto support... no
checking if Net-SNMP needs crypto support... yes
checking for CRYPTO_free in -lcrypto... yes
checking for snmp_timeout in -lnetsnmp... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: config/config.h is unchanged
config.status: executing default-1 commands
su-2.05b# make
source='poller.c' object='poller.o' libtool=no depfile='.deps/poller.Po' tmpdepfile='.deps/poller.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 poller.c || echo './'`poller.c
poller.c: In function `poll_host':
poller.c:672: syntax error before `int'
poller.c:674: `buffer' undeclared (first use in this function)
poller.c:674: (Each undeclared identifier is reported only once
poller.c:674: for each function it appears in.)
poller.c:685: syntax error before `char'
poller.c:687: `result_string' undeclared (first use in this function)
poller.c:687: `delim' undeclared (first use in this function)
*** Error code 1

Stop in /usr/home/anh/cactid.
su-2.05b#
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

anh wrote:Still getting an error
Ok, try this
1. Unpack latest released version of cactid
2. overwrite files from attached in this thread cactid.zip
3. remove config.h in main directory
4. overwrite files from attached old-gcc-fix.tar.gz
5. Run configure and make
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

its the same :(
su-2.05b# ./configure
checking build system type... i386-unknown-freebsd4.11
checking host system type... i386-unknown-freebsd4.11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) nawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
checking whether to enable -Wall... no
checking for kstat_lookup in -lkstat... no
checking for gethostbyname in -lnsl... no
checking for socket in -lsocket... no
checking for floor in -lm... yes
checking for pthread_exit in -lpthread... no
checking for deflate in -lz... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for unsigned long long... yes
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking for gettimeofday... yes
checking for strerror... yes
checking for strtoll... yes
checking for mysql_init in -lmysqlclient... yes
checking for mysql_thread_init in -lmysqlclient... yes
checking if UCD-SNMP needs crypto support... no
checking if Net-SNMP needs crypto support... yes
checking for CRYPTO_free in -lcrypto... yes
checking for snmp_timeout in -lnetsnmp... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
su-2.05b# make
source='sql.c' object='sql.o' libtool=no depfile='.deps/sql.Po' tmpdepfile='.deps/sql.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 'sql.c' || echo './'`sql.c
source='cactid.c' object='cactid.o' libtool=no depfile='.deps/cactid.Po' tmpdepfile='.deps/cactid.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 'cactid.c' || echo './'`cactid.c
source='util.c' object='util.o' libtool=no depfile='.deps/util.Po' tmpdepfile='.deps/util.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 'util.c' || echo './'`util.c
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
source='locks.c' object='locks.o' libtool=no depfile='.deps/locks.Po' tmpdepfile='.deps/locks.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 'locks.c' || echo './'`locks.c
source='poller.c' object='poller.o' libtool=no depfile='.deps/poller.Po' tmpdepfile='.deps/poller.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 'poller.c' || echo './'`poller.c
poller.c: In function `poll_host':
poller.c:672: syntax error before `int'
poller.c:674: `buffer' undeclared (first use in this function)
poller.c:674: (Each undeclared identifier is reported only once
poller.c:674: for each function it appears in.)
poller.c:685: syntax error before `char'
poller.c:687: `result_string' undeclared (first use in this function)
poller.c:687: `delim' undeclared (first use in this function)
*** Error code 1

Stop in /usr/home/anh/cactid/cacti.
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

anh wrote:its the same :(
Ok, here's my version attached
Attachments
fixed.zip
(171.59 KiB) Downloaded 204 times
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

Basilio Cat wrote:
anh wrote:its the same :(
Ok, here's my version attached
It works :) thanx, you are the man !
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

Here's slightly fixed patch for snapshot version (just one cosmetic change)
Attachments
patch-new.txt
(2.67 KiB) Downloaded 261 times
Last edited by Basilio Cat on Thu Nov 10, 2005 4:20 am, edited 2 times in total.
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

Here's patch for released version cactid-0.8.6f
For FreeBSD this file can be put in /usr/ports/net/cactid/files
and
#make clean build install
in port directory will work seamlessly
Attachments
patch-gcc.txt
(2.64 KiB) Downloaded 204 times
Last edited by Basilio Cat on Thu Nov 10, 2005 6:36 am, edited 2 times in total.
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

just tested the ports-version with patch-gcc.txt, its does not work
su-2.05b# mv patch-gcc.txt /usr/ports/net/cacti/files/
su-2.05b# cd /usr/ports/net/cactid/
su-2.05b# make clean build install
===> Cleaning for libiconv-1.9.2_1
===> Cleaning for mysql-client-4.1.15
===> Cleaning for autoconf-2.59_2
===> Cleaning for gettext-0.14.5
===> Cleaning for gmake-3.80_2
===> Cleaning for libtool-1.5.20
===> Cleaning for m4-1.4.3
===> Cleaning for p5-gettext-1.03
===> Cleaning for readline-5.0
===> Cleaning for perl-5.8.7
===> Cleaning for help2man-1.36.2
===> Cleaning for net-snmp-5.2.1.2
===> Cleaning for rc_subr-1.31_1
===> Cleaning for expat-1.95.8_3
===> Cleaning for cactid-0.8.6.f_1
===> Vulnerability check disabled, database not found
===> Extracting for cactid-0.8.6.f_1
=> Checksum OK for cacti-cactid-0.8.6f-1.tar.gz.
===> Patching for cactid-0.8.6.f_1
===> Applying FreeBSD patches for cactid-0.8.6.f_1
===> cactid-0.8.6.f_1 depends on shared library: netsnmp.7 - found
===> cactid-0.8.6.f_1 depends on shared library: mysqlclient.14 - found
===> Configuring for cactid-0.8.6.f_1
configure: WARNING: you should use --build, --host, --target
checking build system type... i386-portbld-freebsd4.11
checking host system type... i386-portbld-freebsd4.11
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) nawk
checking for i386-portbld-freebsd4.11-gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc
checking how to run the C preprocessor... cc -E
checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel
checking whether ln -s works... yes
checking for i386-portbld-freebsd4.11-ranlib... no
checking for ranlib... ranlib
checking whether to enable -Wall... no
checking for kstat_lookup in -lkstat... no
checking for gethostbyname in -lnsl... no
checking for socket in -lsocket... no
checking for floor in -lm... yes
checking for pthread_exit in -lpthread... no
checking for deflate in -lz... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for unsigned long long... yes
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking for gettimeofday... yes
checking for strerror... yes
checking for strtoll... yes
checking for mysql_init in -lmysqlclient... yes
checking for mysql_thread_init in -lmysqlclient... yes
checking if UCD-SNMP needs crypto support... no
checking if Net-SNMP needs crypto support... yes
checking for CRYPTO_free in -lcrypto... yes
checking for snmp_timeout in -lnetsnmp... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
===> Building for cactid-0.8.6.f_1
source='sql.c' object='sql.o' libtool=no depfile='.deps/sql.Po' tmpdepfile='.deps/sql.TPo' depmode=gcc /bin/sh ./config/depcomp cc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -O -pipe -c `test -f 'sql.c' || echo './'`sql.c
source='cactid.c' object='cactid.o' libtool=no depfile='.deps/cactid.Po' tmpdepfile='.deps/cactid.TPo' depmode=gcc /bin/sh ./config/depcomp cc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -O -pipe -c `test -f 'cactid.c' || echo './'`cactid.c
source='util.c' object='util.o' libtool=no depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' depmode=gcc /bin/sh ./config/depcomp cc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -O -pipe -c `test -f 'util.c' || echo './'`util.c
source='snmp.c' object='snmp.o' libtool=no depfile='.deps/snmp.Po' tmpdepfile='.deps/snmp.TPo' depmode=gcc /bin/sh ./config/depcomp cc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -O -pipe -c `test -f 'snmp.c' || echo './'`snmp.c
snmp.c: In function `snmp_get_multi':
snmp.c:311: syntax 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.)
*** 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.
Basilio Cat
Posts: 25
Joined: Sun Sep 12, 2004 1:13 pm

Post by Basilio Cat »

anh wrote:just tested the ports-version with patch-gcc.txt, its does not work
su-2.05b# mv patch-gcc.txt /usr/ports/net/cacti/files/
Erm, well, /usr/ports/net/cactid/files/ not /usr/ports/net/cacti/files/
anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

Basilio Cat wrote:
anh wrote:just tested the ports-version with patch-gcc.txt, its does not work
su-2.05b# mv patch-gcc.txt /usr/ports/net/cacti/files/
Erm, well, /usr/ports/net/cactid/files/ not /usr/ports/net/cacti/files/
DOH !

Works great :) I have to get some more sleep :o
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You guys are great! Thanks for the help....

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

Post by TheWitness »

Just reviewed the patch. I would like to move all the declarations to the top of poller.c if that's ok. Therefore, I will need one of you to volunteer to recompile SVN. I will give you the NOD. It will likely be on Friday.

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

Post by Basilio Cat »

TheWitness wrote:Just reviewed the patch. I would like to move all the declarations to the top of poller.c if that's ok. Therefore, I will need one of you to volunteer to recompile SVN. I will give you the NOD. It will likely be on Friday.

Larry
Yes, moving it in the beginning of the function is most preferred way, i've just made it so to minimize changes in code.

And ok, I can test new version - just let me know.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest