Showing posts with label DLL. Show all posts
Showing posts with label DLL. Show all posts

Wednesday, January 4, 2012

How to convert a DLL to LIB for Windows

Source: http://support.microsoft.com/?scid=kb%3Ben-us%3B131313&x=1&y=15

1. Start Visual Studio Tools command promopt from Start -> Program Files -> Microsoft Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 Command Prompt
2. Create the .def file for the target DLL if you don't have it on hand by entering following command
  DUMPBIN /EXPORTS PATH_TO_DLL_IN_QUESTION
  (Ex. dumpbin /exports D:\Ts2Sqlite\sqlite3.dll)
3. To create the import library (.LIB), run following command
  LIB /def:PATH_TO_DEF_OF_DLL /out:OUTPUT_PATH /machine:x86
  (Ex. lib /def:D:\Ts2Sqlite\sqlite3.def /out:D:\Ts2Sqlite\sqlite3.lib /machine:x86)
4. Now you can use this LIB file along with the DLL like using a real LIB file


   

Wednesday, February 18, 2009

Make the DLL compiled-linked with GCC under Cygwin valid and acceptable for Microsoft Visual Studio

First of all, we need to have the DLL and DEF files generated by GCC. Here is the command to do so.
Assuming we have foo.c
gcc -mno-cygwin -shared -o foo.dll foo.c -Wl,--output-def,foo.def,--out-implib,libfoo.a
The output files are foo.dll, libfoo.a, foo.def.
Second, using Microsoft Library Manager lib.exe utility to generate the foo.lib with foo.def. Here is the command:
lib.exe /machine:i386 /def:foo.def
Then we will get a foo.lib
Now, we are ready to use it in the Visual Studio's Project.
All you need to do is to add the foo.lib to Linker->Input->Additional Dependencies field and put foo.lib and foo.dll in your project's folder.
P.S. If you cannot find lib.exe or fail to launch lib.exe, check the PATH of your System Variables. (right click on My Computer->Properties->Advanced tab->Environment Variables->System Variables)
Make sure C:\Program Files\Microsoft Visual Studio 8\VC\bin and C:\Program Files\Microsoft Visual Studio 8\Common7\IDE are there in the PATH.

Check clients which connect to Mac OS X Wi-Fi Internet Sharing

arp -i bridge100 -a bridge100 may be different on your Mac OSX