Subject: Re: MSVC link: How to convert a .lib to a .dll
From: [email-masked] (root)

7 Jul 1997 17:48:18 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked] (Paul J. Metzger)
Original-Cc: [email-masked]
In-Reply-To: <[email-masked]> from "Paul J. Metzger" at Jul 7, 97 05:32:26 pm
Content-Type: text
Original-Sender: [email-masked]

> 
> The MSVC libraries I need to use have been provided as .LIBs by a
> third party.  Is there an easy way to convert these to DLLs without
> access to their source code?
> 							- Paul
> 
It could be done as follows:
First Method:
------------
1. Build a C file with a function table. In that table you should
   put all functions you want to use. This is to force 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.
Second method:
-------------
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 with an initialized function pointer.
3. Build a dummy LibMain
4. Link all the objects with this file+LibMain.
5. Write a .def.
6. Link.

This is a lot of work (half a day or so), but much less than writing
the runtime library of msvc under cygnus... :-)

Good luck!

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".