Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com To: cygwin AT sourceware DOT cygnus DOT com Subject: Building import lib(.a) from windows lib(.lib) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000915102917A.higuchi@cov.tytlabs.co.jp> Date: Fri, 15 Sep 2000 10:29:17 +0900 (JST) From: Kazunori Higuchi X-Dispatcher: imput version 20000228(IM140) Lines: 30 Hi, I want to link a Windows library(.lib) with gcc on WinNT Cygwin-b20.1. (The library(.lib) does not come with .dll nor .def file.) I could find the following FAQ in the Cygwin FAQ site (http://sources.redhat.com/cygwin/faq/), but I could not trace its procedure since I'm new to Windows programings. Could anyone give me some more details or example for creating a .a file from a .lib file? > How do I link against .lib files? > > (Please note: This section has not yet been updated for the latest net release.) > > 1. Build a C file with a function table. Put all functions you intend to use in that table. This forces the linker to include all the object files from > the .lib. Maybe there is an option to force LINK.EXE to include an object file. 2. Build a dummy 'LibMain'. 3. Build a .def with all the exports > you need. 4. Link with your .lib using link.exe. > > or > > 1. Extract all the object files from the .lib using LIB.EXE. 2. Build a dummy C file referencing all the functions you need, either with a direct > call or through an initialized function pointer. 3. Build a dummy LibMain. 4. Link all the objects with this file+LibMain. 5. Write a .def. 6. Link. > > You can use these methods to use MSVC (and many other runtime libs) with Cygwin development tools. > > Note that this is a lot of work (half a day or so), but much less than rewriting the runtime library in question from specs... > > (thanks to Jacob Navia (root AT jacob DOT remcomp DOT fr) for this explanation) Thanks in advance, -- Kaz -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com