This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: regex pb ?


Emmanuel Blot wrote:
> The code coming from the openldap project that checks the POSIX compatibilty runs well under Linux, but fails under cygwin:
> 
> #include <sys/types.h>
> #include <regex.h>
> static char *pattern, *string;
> main()
> {
>  int rc;
>  regex_t re;
> 
>  pattern = "^A";
> 
>  if(regcomp(&re, pattern, 0)) {
>    /* returns 167837896 !! */
>   return -1;
>  }
> 
>   /* ... */
> }
> 
> Any idea ?

Did you link with -lregex? Otherwise you will link to the Cygwin
builtin regcomp function which is the old V8 regexp functionality.
The corresponding header is regexp.h. If you want the POSIX
implementation you have to link with -lregex.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                        mailto:cygwin@sources.redhat.com
Red Hat, Inc.
mailto:vinschen@redhat.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]