compile nrpe on Solaris

Jeff Mercer mercer at btitelecom.net
Tue May 13 15:05:20 CEST 2003


Joe Leone wrote:
> I am trying to compile nrpe nrpe-2.0b3 on Solaris 7.

Wheee!

> I get an error  as below.
> 
> gcc -g -O2 -I/usr/local/ssl/include/openssl -DHAVE_CONFIG_H -L/lib  -lssl -lcrypto -o nrpe -lnsl -lsocket nrpe.c utils.c
> In file included from ../common/common.h:24,
> ./common/config.h:54: syntax error before "typedef"
> In file included from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.2.3/include/sys/types.h:33,
>                  from /usr/include/strings.h:11,
>                  from ../common/config.h:74,
>                  from ../common/common.h:24,
>                  from nrpe.c:21:
> /usr/include/sys/machtypes.h:33: syntax error before "typedef"
> 
> I have seen a number of people ask about compiling nrpe on Solaris and HP but no solution to fix it.  People have responded that they have compiled it successfully. I have downloaded some of the binaries but they are older version which do not have SSL. 
> Can some one tell me how they achieved it. I suspect it has something to do with u_int32_t

I had problems with NRPE 1.8 on Solaris 7 AND Solaris 8 boxes. I was annoyed 
to find that on a few of my systems there was no problem, while on others it 
worked fine. I did indeed narrow it down to the typedef declaration for 
u_int32_t.

 From what I was able to determine, the systems where it compiled fine had 
Berkley DB installed. There was a /usr/include/db.h file which happened to 
define the u_int32_t type, and through some chain of includes I can't recall 
this would allow nrpe to compile.

Anyways, it's a very fix. Once you've done your ./configure command sequence 
in the NRPE source directory (Including whatever parameters you may want to 
pass to the configure script), you just need to modify the common.h file in 
the common directory and add:

	typedef unsigned int u_int32_t;

right near the top, just after the first #include statement. Then do a make 
and it should compile fine.




-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
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