Hi ganglia developers,
I'm a relatively new user of Ganglia.  I'm using it to monitor a data 
acquisition system,
in which each component of the data acquisition system will have the 
possibility of
injecting custom metrics.  I'm creating a C++ wrapper for the gmetric C 
functions to make
it easier to inject the custom metrics, but am having a problem compiling code 
that
uses the ganglia.h header file with a C++ compiler.  This is that when compiling
code that has this:

extern "C" {
 #include ganglia.h
}

I receive errors like this:
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:24: error: 
conflicting declaration ‘typedef struct
Ganglia_pool* Ganglia_pool’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:24: error: 
‘struct Ganglia_pool’ has a previous
declaration as ‘struct Ganglia_pool’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:25: error: 
conflicting declaration ‘typedef struct
Ganglia_gmond_config* Ganglia_gmond_config’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:25: error: 
‘struct Ganglia_gmond_config’ has a
previous declaration as ‘struct Ganglia_gmond_config’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:26: error: 
conflicting declaration ‘typedef struct
Ganglia_udp_send_channels* Ganglia_udp_send_channels’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:26: error: 
‘struct Ganglia_udp_send_channels’ has a
previous declaration as ‘struct Ganglia_udp_send_channels’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:29: error: 
field ‘pool’ has incomplete type
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:34: error: 
conflicting declaration ‘typedef struct
Ganglia_metric* Ganglia_metric’
/fnal/ups/prd/ganglia/v3_1_2/Linux64bit+2.6-2.5/include/ganglia.h:28: error: 
‘struct Ganglia_metric’ has a previous
declaration as ‘struct Ganglia_metric’


I find that the errors come from the ganglia.h typedef's:

typedef struct Ganglia_pool* Ganglia_pool;
typedef struct Ganglia_gmond_config* Ganglia_gmond_config;
typedef struct Ganglia_udp_send_channels* Ganglia_udp_send_channels;
...
typedef struct Ganglia_metric * Ganglia_metric;

and that I can fix this problem by redefining the typedef's as:

typedef struct Ganglia_pool* Ganglia_pool_t;
typedef struct Ganglia_gmond_config* Ganglia_gmond_config_t;
etc.

and then changing it's use in gmond.c, libgmond.c and gmetric.c to reflect
this naming change.

Is it possible to have this change implemented in the ganglia distribution?
Or is there a better way?
Thanks in advance for your help.
-Sue Kasahara



------------------------------------------------------------------------------
_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to