X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <4725D1BA.C2D2ED8A@dessent.net> Date: Mon, 29 Oct 2007 05:27:38 -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: llrint implementation in Cygwin References: <46F6C151 DOT 3070301 AT computer DOT org> 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-Id: 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 Victor Paesa wrote: > I found another way: leverage the llrint() implementation in MinGW. > > a) We need first to download the mingw-runtime Cygwin package. > > b) Then we create a small library: > > ar x /usr/lib/mingw/libmingwex.a llrint.o > ar cq /usr/local/lib/libllrint.a llrint.o > > c) And finally, we use that library in FFmpeg configure line: > > --extra-ldflags='-L /usr/local/lib' --extra-libs='-l llrint' > > It might not be the most elegant solution, but it is strightforward, and > it works. This is a very, very bad idea. MinGW uses a completely different and incompatible C runtime (MSVCRT) and so any MinGW object that calls into the runtime (e.g. malloc(), open(), printf(), etc) will crash and burn hard when linked to the Cygwin runtime. It is simple blind luck that llrint() is apparently a self-contained function that has no calls to any C runtime support functions, but this is not a practical technique in general. If you want to re-use the MinGW implementation, do it by compiling the source with Cygwin's gcc, not by extracting an object from a library. 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/