X-Spam-Check-By: sourceware.org Message-ID: <4488FFB5.6D34649@dessent.net> Date: Thu, 08 Jun 2006 21:57:25 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: gcc -mno-cygwin still wants to link with cygwin libs References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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 Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Peter Amstutz wrote: > However, the real problem is that when ld searches the linker path, it > seems to do so in several phases, and is the way this search works is > troublesome. I should note that it does find files that end it ".lib", > but only AFTER it has searched the ENTIRE path for files ending in > ".dll.a". What this means is that "libjpeg.dll.a" from cygwin, although > at the very end of the search path, is found and matched before > "jpeg.lib", which is at the very beginning of the search path, but the > misfortune of having the wrong name and relegated to the second search > pass. It is discriminated against. If I rename "jpeg.lib" to > "libjpeg.dll.a", it finds the correct link library at the correct > location. The search order is documented: . My advice is just specify the filename of the library directly, without flags, e.g. "/path/to/file.lib" and don't try to use -L or -l. There should be zero ambiguity if you do this. > used by several different compilers, so I'm trying to avoid having to keep > multiple copies around to work around this problem just because cygwin > wants to be special. Frankly I'm surprised that ld ever finds a file named foo.lib when you specify -lfoo. Cygwin's gcc is a part of the gnu toolchain and tries to follow the same file naming conventions that the gnu toolchain uses on all platforms. And in that convention libraries end in .a. It is most certainly not "just being special". You're trying to put a square peg in a round hole mixing -lfoo and files named .lib, and I'm not surprised that it doesn't work in ways that make sense. You might as well ask Microsoft why their linker's default search rules won't ever find an import library named ".dll.a" and see what their response is. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/