This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
1.3.1 : again a regex problem (even with -lregex)
- To: cygwin at cygwin dot com
- Subject: 1.3.1 : again a regex problem (even with -lregex)
- From: Altac Edena <altacsd at yahoo dot fr>
- Date: Tue, 8 May 2001 07:56:32 +0200 (CEST)
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