Mail Archives: cygwin/2001/05/08/01:56:48
I've read many messages from the mailing list
concerning the regex "bug", but the given solution
(linking with libregex.a) doesn't work for me. It
seems gcc just ignores the library. I only noticed
that if I compile the regex source files and link all
the regXXX.o with my own code, then it works.
I m using Cygwin 1.3.1 including regex-4.4.
My test code :
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
void main()
{
regex_t preg;
int errcode;
if( (errcode = regcomp(&preg, "hello", 0)) )
printf("Error = %d\n", errcode);
else
{
printf("Success\n");
regfree(&preg);
}
}
If I compile with :
gcc -o mytest -lregex mytest.c
I get this output :
Error = 167837880
If I compile with :
gcc -c mytest.c
gcc -o mytest mytest.o regcomp.o regfree.o
I get this output :
Success
Any idea ? Maybe I missed something really stupid, but
...
___________________________________________________________
Do You Yahoo!? -- Pour faire vos courses sur le Net,
Yahoo! Shopping : http://fr.shopping.yahoo.com
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -