This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: MSVC link: How to convert a .lib to a .dll


> 
> 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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]