| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| X-Trace-PostClient-IP: | 68.147.232.190 |
| From: | Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Djgpp C compiler regEx comilation PB |
| Organization: | Systematic Software |
| Message-ID: | <tcv0m217rdfvg6e3n0k2sbuivqeeh3c89g@4ax.com> |
| References: | <45605ffa$0$2291$426a34cc AT news DOT free DOT fr> |
| X-Newsreader: | Forte Agent 1.93/32.576 English (American) |
| MIME-Version: | 1.0 |
| Lines: | 52 |
| Date: | Sun, 19 Nov 2006 16:05:05 GMT |
| NNTP-Posting-Host: | 64.59.135.176 |
| X-Complaints-To: | abuse AT shaw DOT ca |
| X-Trace: | pd7urf3no 1163952305 64.59.135.176 (Sun, 19 Nov 2006 09:05:05 MST) |
| NNTP-Posting-Date: | Sun, 19 Nov 2006 09:05:05 MST |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
On Sun, 19 Nov 2006 14:45:05 +0100 in comp.os.msdos.djgpp, "Martin
Boulte" <martin DOT boulte AT free DOT fr> wrote:
>Hi guy,
>I try to compile the myGrep.c program I found on Web at this site
>http://linuxgazette.net/issue55/tindale.html
>which uses regular expression and include regex.h.
>
>I get the following message :
>
>In file included from myGrep.c:11:
>c:/djgpp/include/regex.h:17: syntax error before "regoff_t"
>c:/djgpp/include/regex.h:25: syntax error before "regoff_t"
>c:/djgpp/include/regex.h:66: syntax error before "regmatch_t"
>
>In fact, when I go through regex.h, I get this :
>#ifdef __cplusplus
>extern "C" {
>#endif
>....
>
>#ifdef __cplusplus
>}
>#endif
>which means that if I don't define C++ I do not get regex declaration.
>Does it mean that regex declaration is available only in C++ ?
You are mistaken: those header lines make the definitions valid when
used with a C++ translator as well as a C translator.
>The first declare error comes from typedef off_t regoff_t
Insert:
#include <sys/types.h>
before:
#include <regex.h>
and while you're there, correct:
#include <strings.h>
to
#include <string.h>
as the former is non-standard (none of the functions document their
declaration in the former) and merely includes the latter.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
fake address use address above to reply
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |