jssjr/collectd-write_graphite — Issue #7: Compile with collectd 4.10.3 fails
Author: JarleB
Created: 2011-10-11 09:48:04+00:00
State: open

Hello,

I tried to compile collectd-write_graphite with collectd-4.10.3 with the following result.

$ cat Makefile
COLLECTD_PREFIX?=/usr/
COLLECTD_VERSION=4.10.3

COLLECTD_SRC=work/collectd-$(COLLECTD_VERSION)

LIBTOOL=$(COLLECTD_SRC)/libtool
FETCH=fetch

CFLAGS?=-DNDEBUG -O3

all: .INIT write_graphite.la

install: all
$(LIBTOOL) --mode=install /usr/bin/install -c write_graphite.la \
$(COLLECTD_PREFIX)/lib64/collectd
$(LIBTOOL) --finish \
$(COLLECTD_PREFIX)/lib64/collectd

clean:
rm -rf .libs
rm -rf build
rm -f write_graphite.la

distclean: clean
rm -rf work

.INIT:
mkdir -p build
mkdir -p work
( if [ ! -d $(COLLECTD_SRC)/src ] ; then \
if which fetch ; then \
DOWNLOAD_TOOL=`which fetch` ; \
elif which wget ; then \
DOWNLOAD_TOOL=`which wget` ; \
fi ; \
cd work ; \
$${DOWNLOAD_TOOL} http://collectd.org/files/collectd-$(COLLECTD_VERSION).tar.gz ; \
tar zxvf collectd-$(COLLECTD_VERSION).tar.gz ; \
cd collectd-$(COLLECTD_VERSION) ; \
if [ ! -f libtool ] ; then \
./configure ; \
fi ; \
fi )

write_graphite.la: build/write_graphite.lo
$(LIBTOOL) --tag=CC --mode=link gcc -Wall -Werror $(CFLAGS) -module \
-avoid-version -o $@ -rpath $(COLLECTD_PREFIX)/lib/collectd \
-lpthread build/write_graphite.lo

build/write_graphite.lo: src/write_graphite.c
$(LIBTOOL) --mode=compile gcc -DHAVE_CONFIG_H -I src \
-I $(COLLECTD_SRC)/src -Wall -Werror $(CFLAGS) -MD -MP -c \
-o $@ src/write_graphite.c
[collectd@collectd-test collectd-write_graphite]$
$

(...)

work/collectd-4.10.3/libtool --mode=compile gcc -DHAVE_CONFIG_H -I src \
-I work/collectd-4.10.3/src -Wall -Werror -DNDEBUG -O3 -MD -MP -c \
-o build/write_graphite.lo src/write_graphite.c
mkdir build/.libs
gcc -DHAVE_CONFIG_H -I src -I work/collectd-4.10.3/src -Wall -Werror -DNDEBUG -O3 -MD -MP -c src/write_graphite.c -fPIC -DPIC -o build/.libs/write_graphite.o
src/write_graphite.c:82: error: expected specifier-qualifier-list before ‘cdtime_t’
src/write_graphite.c: In function ‘wg_reset_buffer’:
src/write_graphite.c:96: error: ‘struct wg_callback’ has no member named ‘send_buf_init_time’
cc1: warnings being treated as errors
src/write_graphite.c:96: error: implicit declaration of function ‘cdtime’
src/write_graphite.c: In function ‘wg_send_buffer’:
src/write_graphite.c:111: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c:118: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c: At top level:
src/write_graphite.c:125: error: expected ‘)’ before ‘timeout’
src/write_graphite.c: In function ‘wg_callback_free’:
src/write_graphite.c:211: error: implicit declaration of function ‘wg_flush_nolock’
src/write_graphite.c: At top level:
src/write_graphite.c:221: error: expected ‘)’ before ‘timeout’
src/write_graphite.c:434: error: expected declaration specifiers or ‘...’ before ‘cdtime_t’
src/write_graphite.c: In function ‘wg_send_message’:
src/write_graphite.c:444: error: implicit declaration of function ‘CDTIME_T_TO_DOUBLE’
src/write_graphite.c:452: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c:460: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c:470: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c:491: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c: In function ‘wg_write_messages’:
src/write_graphite.c:535: error: passing argument 3 of ‘wg_send_message’ makes pointer from integer without a cast
src/write_graphite.c:433: note: expected ‘struct wg_callback *’ but argument is of type ‘time_t’
src/write_graphite.c:535: error: too many arguments to function ‘wg_send_message’
src/write_graphite.c:566: error: passing argument 3 of ‘wg_send_message’ makes pointer from integer without a cast
src/write_graphite.c:433: note: expected ‘struct wg_callback *’ but argument is of type ‘time_t’
src/write_graphite.c:566: error: too many arguments to function ‘wg_send_message’
src/write_graphite.c: In function ‘wg_config_carbon’:
src/write_graphite.c:672: error: ‘struct wg_callback’ has no member named ‘send_lock’
src/write_graphite.c:719: error: ‘wg_flush’ undeclared (first use in this function)
src/write_graphite.c:719: error: (Each undeclared identifier is reported only once
src/write_graphite.c:719: error: for each function it appears in.)
make: *** [build/write_graphite.lo] Error 1
[collectd@collectd-test collectd-write_graphite]$