NRPE compilation problem under Tru64

Christophe SUIRE christophe.suire at adelux.fr
Wed Dec 10 17:52:42 CET 2003


Hi,

I have some problems to compile NRPE 2.0 under Tru64 :
First i need to had some include to config.h .. because nothing was  
working :

calamar._root:/tmp/nrpe-2.0>make
cd ./src/; make ; cd ..
gcc -g -O2 -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c
inst emulated pid=143864 <gcc> va=0x11fffe04a pc=0x12000fb7c  
inst=0x282bffff
In file included from ../common/common.h:24,
                  from nrpe.c:21:
../common/config.h:157:20: time.h: No such file or directory
In file included from nrpe.c:21:
../common/common.h:64: parse error before "int16_t"
../common/common.h:64: warning: no semicolon at end of struct or union
../common/common.h:65: warning: data definition has no type or storage  
class
../common/common.h:67: parse error before "result_code"
../common/common.h:67: warning: data definition has no type or storage  
class
../common/common.h:69: parse error before '}' token
../common/common.h:69: warning: data definition has no type or storage  
class
In file included from nrpe.c:24:
utils.h:46: warning: `struct in_addr' declared inside parameter list
utils.h:46: warning: its scope is only this definition or declaration,  
which is probably not what you want.
nrpe.c:47: parse error before '*' token
nrpe.c: In function `main':
nrpe.c:147: `LOG_PID' undeclared (first use in this function)
nrpe.c:147: (Each undeclared identifier is reported only once
nrpe.c:147: for each function it appears in.)
nrpe.c:147: `LOG_DAEMON' undeclared (first use in this function)
nrpe.c:174: `LOG_ERR' undeclared (first use in this function)
nrpe.c:227: `SIGHUP' undeclared (first use in this function)
nrpe.c:227: `SIG_IGN' undeclared (first use in this function)
nrpe.c:238: `O_RDONLY' undeclared (first use in this function)
nrpe.c:239: `O_WRONLY' undeclared (first use in this function)
nrpe.c: In function `read_config_file':
nrpe.c:281: `LOG_ERR' undeclared (first use in this function)
nrpe.c: In function `read_config_dir':
nrpe.c:411: `DIR' undeclared (first use in this function)
nrpe.c:411: `dirp' undeclared (first use in this function)
nrpe.c:419: `LOG_ERR' undeclared (first use in this function)
nrpe.c:424: warning: assignment makes pointer from integer without a  
cast
nrpe.c:427: dereferencing pointer to incomplete type
nrpe.c:428: dereferencing pointer to incomplete type
nrpe.c:437: dereferencing pointer to incomplete type
nrpe.c: In function `add_command':
nrpe.c:493: `LOG_DEBUG' undeclared (first use in this function)
nrpe.c: In function `wait_for_connections':
nrpe.c:515: storage size of `myname' isn't known
nrpe.c:517: storage size of `addr' isn't known
nrpe.c:520: `socklen_t' undeclared (first use in this function)
nrpe.c:520: parse error before "addrlen"
nrpe.c:526: `AF_INET' undeclared (first use in this function)
nrpe.c:526: `SOCK_STREAM' undeclared (first use in this function)
nrpe.c:530: `LOG_ERR' undeclared (first use in this function)
nrpe.c:530: `errno' undeclared (first use in this function)
nrpe.c:536: `SOL_SOCKET' undeclared (first use in this function)
nrpe.c:536: `SO_REUSEADDR' undeclared (first use in this function)
nrpe.c:547: `INADDR_ANY' undeclared (first use in this function)
nrpe.c:567: `LOG_NOTICE' undeclared (first use in this function)
nrpe.c:576: `SIGQUIT' undeclared (first use in this function)
nrpe.c:577: `SIGTERM' undeclared (first use in this function)
nrpe.c:580: `LOG_DEBUG' undeclared (first use in this function)
nrpe.c:590: `EWOULDBLOCK' undeclared (first use in this function)
nrpe.c:590: `EINTR' undeclared (first use in this function)
nrpe.c:619: `addrlen' undeclared (first use in this function)
nrpe.c:637: dereferencing pointer to incomplete type
nrpe.c:637: dereferencing pointer to incomplete type
nrpe.c:640: dereferencing pointer to incomplete type
nrpe.c: In function `handle_connection':
nrpe.c:695: parse error before "receive_packet"
nrpe.c:716: `LOG_DEBUG' undeclared (first use in this function)
nrpe.c:750: `receive_packet' undeclared (first use in this function)
nrpe.c:762: `LOG_ERR' undeclared (first use in this function)
nrpe.c:900: `send_packet' undeclared (first use in this function)
nrpe.c:906: `int16_t' undeclared (first use in this function)
nrpe.c:906: parse error before "htons"
nrpe.c:907: parse error before "htons"
nrpe.c:908: parse error before "htons"
nrpe.c: In function `my_system':
nrpe.c:1001: `errno' used prior to declaration
nrpe.c:1021: `F_SETFL' undeclared (first use in this function)
nrpe.c:1021: `O_NONBLOCK' undeclared (first use in this function)
nrpe.c:1058: `SIGALRM' undeclared (first use in this function)
nrpe.c:1131: `EINTR' undeclared (first use in this function)
nrpe.c:1142: `SIGTERM' undeclared (first use in this function)
nrpe.c:1143: `SIGKILL' undeclared (first use in this function)
nrpe.c: In function `drop_privileges':
nrpe.c:1180: warning: cast to pointer from integer of different size
nrpe.c:1182: dereferencing pointer to incomplete type
nrpe.c:1184: `LOG_ERR' undeclared (first use in this function)
nrpe.c:1205: warning: cast to pointer from integer of different size
nrpe.c:1207: dereferencing pointer to incomplete type
nrpe.c:1222: `errno' undeclared (first use in this function)
nrpe.c:1222: `EPERM' undeclared (first use in this function)
nrpe.c: In function `check_privileges':
nrpe.c:1251: `LOG_ERR' undeclared (first use in this function)
nrpe.c: At top level:
nrpe.c:1261: parse error before '*' token
nrpe.c: In function `validate_request':
nrpe.c:1274: `pkt' undeclared (first use in this function)
nrpe.c:1278: `LOG_ERR' undeclared (first use in this function)
nrpe.c: In function `process_arguments':
nrpe.c:1442: elements of array `long_options' have incomplete type
nrpe.c:1443: warning: excess elements in struct initializer
nrpe.c:1443: warning: (near initialization for `long_options[0]')
nrpe.c:1443: `required_argument' undeclared (first use in this function)
nrpe.c:1443: warning: excess elements in struct initializer
nrpe.c:1443: warning: (near initialization for `long_options[0]')
nrpe.c:1443: warning: excess elements in struct initializer
nrpe.c:1443: warning: (near initialization for `long_options[0]')
nrpe.c:1443: warning: excess elements in struct initializer
nrpe.c:1443: warning: (near initialization for `long_options[0]')
nrpe.c:1444: warning: excess elements in struct initializer
nrpe.c:1444: warning: (near initialization for `long_options[1]')
nrpe.c:1444: `no_argument' undeclared (first use in this function)
nrpe.c:1444: warning: excess elements in struct initializer
nrpe.c:1444: warning: (near initialization for `long_options[1]')
nrpe.c:1444: warning: excess elements in struct initializer
nrpe.c:1444: warning: (near initialization for `long_options[1]')
nrpe.c:1444: warning: excess elements in struct initializer
nrpe.c:1444: warning: (near initialization for `long_options[1]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[2]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[2]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[2]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[2]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[3]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[3]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[3]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[3]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[4]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[4]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[4]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[4]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[5]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[5]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[5]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[5]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[6]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[6]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[6]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[6]')
nrpe.c:1442: storage size of `long_options' isn't known
In file included from ../common/common.h:24,
                  from utils.c:32:
../common/config.h:157:20: time.h: No such file or directory
In file included from utils.c:32:
../common/common.h:64: parse error before "int16_t"
../common/common.h:64: warning: no semicolon at end of struct or union
../common/common.h:65: warning: data definition has no type or storage  
class
../common/common.h:67: parse error before "result_code"
../common/common.h:67: warning: data definition has no type or storage  
class
../common/common.h:69: parse error before '}' token
../common/common.h:69: warning: data definition has no type or storage  
class
In file included from utils.c:33:
utils.h:46: warning: `struct in_addr' declared inside parameter list
utils.h:46: warning: its scope is only this definition or declaration,  
which is probably not what you want.
utils.c: In function `my_connect':
utils.c:124: storage size of `servaddr' isn't known
utils.c:130: `AF_INET' undeclared (first use in this function)
utils.c:130: (Each undeclared identifier is reported only once
utils.c:130: for each function it appears in.)
utils.c:137: warning: assignment makes pointer from integer without a  
cast
utils.c:143: dereferencing pointer to incomplete type
utils.c:143: dereferencing pointer to incomplete type
utils.c:147: warning: assignment makes pointer from integer without a  
cast
utils.c:153: `PF_INET' undeclared (first use in this function)
utils.c:153: `SOCK_DGRAM' undeclared (first use in this function)
utils.c:153: `SOCK_STREAM' undeclared (first use in this function)
utils.c:153: dereferencing pointer to incomplete type
utils.c:162: `errno' undeclared (first use in this function)
utils.c:163: `ECONNREFUSED' undeclared (first use in this function)
utils.c:166: `ETIMEDOUT' undeclared (first use in this function)
utils.c:169: `ENETUNREACH' undeclared (first use in this function)
utils.c: At top level:
utils.c:186: warning: `struct in_addr' declared inside parameter list
utils.c:186: conflicting types for `my_inet_aton'
utils.h:46: previous declaration of `my_inet_aton'
utils.c: In function `my_inet_aton':
utils.c:279: dereferencing pointer to incomplete type
utils.c: In function `recvall':
utils.c:350: `errno' undeclared (first use in this function)
utils.c:350: `EAGAIN' undeclared (first use in this function)
*** Exit 1
Stop.
*** Exit 1
Stop.

After paching the config.h i have :

with gcc :
------------

calamar._root:/tmp/nrpe-2.0/src>gcc -I/usr/sys/include  
-I/usr/include/sys -I../common -g -O2 -DHAVE_CONFIG_H -o nrpe nrpe.c  
utils>
inst emulated pid=142242 <gcc> va=0x11fffe04a pc=0x12000fb7c  
inst=0x282bffff
nrpe.c: In function `wait_for_connections':
nrpe.c:522: `socklen_t' undeclared (first use in this function)
nrpe.c:522: (Each undeclared identifier is reported only once
nrpe.c:522: for each function it appears in.)
nrpe.c:522: parse error before "addrlen"
nrpe.c:621: `addrlen' undeclared (first use in this function)
nrpe.c: In function `drop_privileges':
nrpe.c:1182: warning: cast to pointer from integer of different size
nrpe.c:1184: dereferencing pointer to incomplete type
nrpe.c:1207: warning: cast to pointer from integer of different size
nrpe.c:1209: dereferencing pointer to incomplete type
nrpe.c: In function `process_arguments':
nrpe.c:1444: elements of array `long_options' have incomplete type
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[0]')
nrpe.c:1445: `required_argument' undeclared (first use in this function)
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[0]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[0]')
nrpe.c:1445: warning: excess elements in struct initializer
nrpe.c:1445: warning: (near initialization for `long_options[0]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[1]')
nrpe.c:1446: `no_argument' undeclared (first use in this function)
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[1]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[1]')
nrpe.c:1446: warning: excess elements in struct initializer
nrpe.c:1446: warning: (near initialization for `long_options[1]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[2]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[2]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[2]')
nrpe.c:1447: warning: excess elements in struct initializer
nrpe.c:1447: warning: (near initialization for `long_options[2]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[3]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[3]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[3]')
nrpe.c:1448: warning: excess elements in struct initializer
nrpe.c:1448: warning: (near initialization for `long_options[3]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[4]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[4]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[4]')
nrpe.c:1449: warning: excess elements in struct initializer
nrpe.c:1449: warning: (near initialization for `long_options[4]')
nrpe.c:1450: warning: excess elements in struct initializer
nrpe.c:1450: warning: (near initialization for `long_options[5]')
nrpe.c:1450: warning: excess elements in struct initializer
nrpe.c:1450: warning: (near initialization for `long_options[5]')
nrpe.c:1450: warning: excess elements in struct initializer
nrpe.c:1450: warning: (near initialization for `long_options[5]')
nrpe.c:1450: warning: excess elements in struct initializer
nrpe.c:1450: warning: (near initialization for `long_options[5]')
nrpe.c:1451: warning: excess elements in struct initializer
nrpe.c:1451: warning: (near initialization for `long_options[6]')
nrpe.c:1451: warning: excess elements in struct initializer
nrpe.c:1451: warning: (near initialization for `long_options[6]')
nrpe.c:1451: warning: excess elements in struct initializer
nrpe.c:1451: warning: (near initialization for `long_options[6]')
nrpe.c:1451: warning: excess elements in struct initializer
nrpe.c:1451: warning: (near initialization for `long_options[6]')
nrpe.c:1444: storage size of `long_options' isn't known
utils.c: In function `my_connect':
utils.c:137: warning: assignment makes pointer from integer without a  
cast
utils.c:143: dereferencing pointer to incomplete type
utils.c:143: dereferencing pointer to incomplete type
utils.c:147: warning: assignment makes pointer from integer without a  
cast
utils.c:153: dereferencing pointer to incomplete type

with cc:
----------

calamar._root:/tmp/nrpe-2.0/src>cc -I/usr/sys/include  
-I/usr/include/sys -I../common -g -O2 -DHAVE_CONFIG_H -o nrpe nrpe.c  
utils.>
nrpe.c:
cc: Info: File not optimized; use -g3 if both optimization and debug  
wanted. (suppressoptlvl)
cc: Error: nrpe.c, line 522: In this declaration, "socklen_t" must  
specify a type. (badparsedecl)
         socklen_t addrlen;
--------^
cc: Warning: nrpe.c, line 545: In this statement, the referenced type  
of the pointer value "&myname.sin_zero" is "array [8] of char", which  
is not compatible with "char". (ptrmismatch)
         bzero(&myname.sin_zero,8);
--------------^
cc: Error: nrpe.c, line 621: In this statement, "addrlen" is not  
declared. (undeclared)
                                 addrlen=sizeof(addr);
--------------------------------^
cc: Warning: nrpe.c, line 902: In this statement, the referenced type  
of the pointer value "&send_packet" is "struct packet_struct", which is  
not compatible with "char". (ptrmismatch)
         bzero(&send_packet,sizeof(send_packet));
--------------^
cc: Warning: nrpe.c, line 1184: In this statement, "grp" is a pointer  
to an incomplete struct or union and should not be used as the left  
operand of a member dereference. (incompderef)
                                 gid=(gid_t)(grp->gr_gid);
--------------------------------------------^
cc: Error: nrpe.c, line 1184: In this statement, "gr_gid" is not a  
member of "grp". (needmember)
                                 gid=(gid_t)(grp->gr_gid);
--------------------------------------------^
cc: Warning: nrpe.c, line 1209: In this statement, "pw" is a pointer to  
an incomplete struct or union and should not be used as the left  
operand of a member dereference. (incompderef)
                                 uid=(uid_t)(pw->pw_uid);
--------------------------------------------^
cc: Error: nrpe.c, line 1209: In this statement, "pw_uid" is not a  
member of "pw". (needmember)
                                 uid=(uid_t)(pw->pw_uid);
--------------------------------------------^
cc: Error: nrpe.c, line 1445: In the initializer for long_options, an  
array's element type is incomplete, which precludes its initialization.  
(incompelinit)
                 {"config", required_argument, 0, 'c'},
----------------^
utils.c:
cc: Info: File not optimized; use -g3 if both optimization and debug  
wanted. (suppressoptlvl)
cc: Warning: utils.c, line 137: In this statement, "gethostbyname(...)"  
of type "int", is being converted to "pointer to struct hostent".  
(cvtdiftypes)
                 hp=gethostbyname((const char *)host_name);
----------------^
cc: Warning: utils.c, line 143: In this statement, "hp" is a pointer to  
an incomplete struct or union and should not be used as the left  
operand of a member dereference. (incompderef)
                 memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length);
------------------------------------------^
cc: Error: utils.c, line 143: In this statement, "h_addr" is not a  
member of "hp". (needmember)
                 memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length);
------------------------------------------^
cc: Warning: utils.c, line 143: In this statement, "hp" is a pointer to  
an incomplete struct or union and should not be used as the left  
operand of a member dereference. (incompderef)
                 memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length);
-----------------------------------------------------^
cc: Error: utils.c, line 143: In this statement, "h_length" is not a  
member of "hp". (needmember)
                 memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length);
-----------------------------------------------------^
cc: Warning: utils.c, line 147: In this statement,  
"getprotobyname(...)" of type "int", is being converted to "pointer to  
struct protoent". (cvtdiftypes)
         if(((ptrp=getprotobyname(proto)))==NULL){
-------------^
cc: Warning: utils.c, line 153: In this statement, "ptrp" is a pointer  
to an incomplete struct or union and should not be used as the left  
operand of a member dereference. (incompderef)
          
*sd=socket(PF_INET,(!strcmp(proto,"udp"))?SOCK_DGRAM:SOCK_STREAM,ptrp- 
 >p_proto);
------------------------------------------------------------------------ 
-^
cc: Error: utils.c, line 153: In this statement, "p_proto" is not a  
member of "ptrp". (needmember)
          
*sd=socket(PF_INET,(!strcmp(proto,"udp"))?SOCK_DGRAM:SOCK_STREAM,ptrp- 
 >p_proto);
------------------------------------------------------------------------ 
-^

-- 
Christophe Suire                       <christophe.suire at adelux.fr>
Directeur Technique Adelux                 <http://www.adelux.fr>
Tel : 01.46.88.40.25
Fax : 01.47.90.26.32



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list