troubleshooting Question

Correcting compile error in /usr/include/regex.h

Avatar of Tintin
Tintin asked on
Unix OSC
3 Comments1 Solution1581 ViewsLast Modified:
I'm trying to compile Nagios NSCA 2.7 on FreeBSD 4.7 (I know it's very old).

and get the following errors:

bash-2.05b# make
cd ./src/; make all ; cd ..
gcc -g -O2 -DHAVE_CONFIG_H -o nsca nsca.c netutils.c utils.c   -lwrap
In file included from ../include/config.h:92,
                 from ../include/common.h:24,
                 from nsca.c:18:
/usr/include/regex.h:46: syntax error before `regoff_t'
/usr/include/regex.h:46: warning: data definition has no type or storage class
/usr/include/regex.h:56: syntax error before `regoff_t'
In file included from ../include/config.h:92,
                 from ../include/common.h:24,
                 from netutils.c:32:
/usr/include/regex.h:46: syntax error before `regoff_t'
/usr/include/regex.h:46: warning: data definition has no type or storage class
/usr/include/regex.h:56: syntax error before `regoff_t'
In file included from ../include/config.h:92,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/regex.h:46: syntax error before `regoff_t'
/usr/include/regex.h:46: warning: data definition has no type or storage class
/usr/include/regex.h:56: syntax error before `regoff_t'
*** Error code 1

Stop in /usr/home/peters/nsca-2.7.2/src.
*** Error code 1


I saw a reference on a site to fix which said:

"there was an error on FreeBSD 4.9 corrected with int substitution in /usr/include/regex.h"

Not being a C programmer, I'm not sure what I need to change in the relevant section of regex.h below:

typedef off_t regoff_t;

typedef struct {
        int re_magic;
        size_t re_nsub;         /* number of parenthesized subexpressions */
        __const char *re_endp;  /* end pointer for REG_PEND */
        struct re_guts *re_g;   /* none of your business :-) */
} regex_t;

typedef struct {
        regoff_t rm_so;         /* start of match */
        regoff_t rm_eo;         /* end of match */
} regmatch_t;




Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros