A note of using Cygwin to link win32 DLL file

发表于:2007-07-04来源:作者:点击数: 标签:
I am describing how to link dll in the Cygwin environment here. This is so basic for most of the people who are using Cygwin, I guess. :-) UnderWindows , suppose you are going to develop anything without yourfavourate development environmen
I am describing how to link dll in the Cygwin environment here. This is so basic for most of the people who are using Cygwin, I guess. :-)


UnderWindows, suppose you are going to develop anything without yourfavourate development environment, gclearcase/" target="_blank" >cc+emacs+vi, Cygwin definitely willbecome a very good choice for us. However, we are not always relying onthe libraries supplied with Cygwin. We will need Windows style librarydll files. Then how do we link them wil Gcc?

We will need pexports and dlltool.

First, we use pexport to generate the def file.

http://www.emmestech.com/software/cygwin/pexports-0.43/moron1.html

Then, use dlltool to create the dynamic link library file that can be recognized by cygwin.

Example in my case, to use my DAQ card, there is a dll file:

$ pexports.exe filename.dll > filename.def
$ dlltool.exe --dllname filename.dll --def filename.def --output-lib libfilename.a


Terribly say that I have not tried to test the program working or not. I just successfully compiled the program... :-O

-----------------------Reference--------

--------------------------
http://www.emmestech.com/software/cygwin/pexports-0.43/moron1.html
http://sebsauvage.net/python/mingw.html Something related for Python + Swig + Cygwin
http://www.gnu.org/software/binutils/manual/html_chapter/binutils_13.html
---------------------------------------------------------------------

javascript:window.open(this.src);" style="CURSOR: pointer" onload="return imgzoom(this,550)">

原文转自:http://www.ltesting.net