delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/08/01:56:48

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <20010508055632.52908.qmail@web14103.mail.yahoo.com>
Date: Tue, 8 May 2001 07:56:32 +0200 (CEST)
From: =?iso-8859-1?q?Altac=20Edena?= <altacsd AT yahoo DOT fr>
Subject: 1.3.1 : again a regex problem (even with -lregex)
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019