This is the mail archive of the
mailing list for the Cygwin project.
RE: duplicate regexec/regcomp functions detected
- From: "Ralf Habacker" <Ralf dot Habacker at freenet dot de>
- To: <cygwin at cygwin dot com>
- Date: Fri, 28 Dec 2001 12:14:04 +0100
- Subject: RE: duplicate regexec/regcomp functions detected
> On Thu, Dec 27, 2001 at 06:22:43PM +0100, Ralf Habacker wrote:
> >> -----Original Message-----
> >> From: email@example.com [mailto:firstname.lastname@example.org]On Behalf
> >> Of Corinna Vinschen
> >> Sent: Friday, December 14, 2001 11:36 AM
> >> To: cygwin
> >> Subject: Re: duplicate regexec/regcomp functions detected
> >> On Thu, Dec 13, 2001 at 09:18:39PM +0100, Ralf Habacker wrote:
> >> > Hi all,
> >> >
> >> > kde needs the regexp functions regexec and regcomp.
> >> >
> >> > The cygwin lib contains the System V8 function call style, while the pcre
> >> package (pcreposix)
> >> > provides another style (the system V style I guess). The problem is now, that
> both libs
> >> > supports the same names for regexec and regcomp but with different
> >> parameter/return types.
> >> > This results sometimes in execution failures if the libs are not in the right
> order like
> >> > shown in the following example.
> >> >
> >> > pcre regexp wanted
> >> >
> >> > $ gcc ... -lpcreposix -lcygwin -> okay
> >> >
> >> > $ gcc ... -lpthreads|-lm|-lc -lpcreposix -lcygwin -> failure: the functions in
> >> cygwin lib
> >> > are used
> >> But that order should never happen EXCEPT you're making the big
> >> mistake to give `-lm' or `-lc' on the command line explicitly.
> >> Since -lcygwin is appended automagically and libc.a and libm.a
> >> are the same library anyway, the answer is simply, "Don't do that."
> >This may be for -lm and -lc, but what about libpthread
> >Think about this link line:
> >gcc -o test -lpthread main.o [-lcygwin]
> >This will result in multiple defined symbols for WinMain (expected that
> >main.o contains a main function). You can say don't do this, but what
> >about bigger packages like qt. The qt configuring process does only
> >allow like the above link line.
> The above link line makes no sense. It is wrong. It should be
May be, but I think you know some combinations that are real. what is with this ?
Assume main.o needs to be linked to the pcreposix lib.
gcc -o test main.o -lpthread -lpcreposix
or this if main needs to be linked to the regex lib.
gcc -o test main.o -lpthread -lregex
This will fail and the users have to figure out deeply why this does not work. Isn't it ?
The result of this is, that the packager of the pcre and the regex package have to add a note
in their documentation that their lib must be the first lib before -lg or -lpthread and
perhaps more libs in the future. Make this sense ?
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html