Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Ralf Habacker" To: Subject: RE: duplicate regexec/regcomp functions detected Date: Fri, 28 Dec 2001 12:14:04 +0100 Message-ID: <000d01c18f90$c37bfd30$0e6307d5@BRAMSCHE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: <20011227174239.GA24897@redhat.com> > > On Thu, Dec 27, 2001 at 06:22:43PM +0100, Ralf Habacker wrote: > >> -----Original Message----- > >> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]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 > corrected. > 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 ? Regards Ralf > > cgf > > -- > 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 Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/