> Hello there. I am very uninformed when it comes to Microsoft Windows programming. > It's not that hard to make portable code, so compiling my code is not the hard part; > the hard part is figuring out exactly what developers expect from a binary version of > a library. > > On Linux (my main development platform), I can simply build a static library and > shared library and package it along with the headers and that's all I need. > > But on Windows I am not sure exactly what I would need to produce for a binary > version of a library meant to be picked up and used by other developers. I have seen > Windows libraries distributed with .dll files in a 'bin' directory, or sometimes in a > 'lib' directory. Sometimes I see files that end in .def as well. > > Can someone who is a Windows programmer tell me exactly what they would expect to > find in a .zip file that contained a compiled C++ library? Just for reference, I > expect at a minimum to provide: libmame.a, libmame.dll, libmame.h ... > > I have actually read about Windows .dlls and such so I know something of how shared > libraries work on Windows but I can't tell exactly what the conventions are for > distributing them. > > Will a .dll compiled by MingW be sufficient for linking by any Windows compiler? Are > there any special caveats I need to pay attention to? The GNU toolchain doesn't seem > to require all of the 'dllexport/dllimport' baloney that I often see in Windows code > - is that stuff needed for other Windows compilers, or is it just optional? > > I hope to be releasing some code and a library soon and the Linux version has been > ready since forever, but I just finished putting the finishing Windows porting > touches on it and now I have no idea how to actually make a distributable version for > Windows, so any hints at all will be most helpful. > > Thanks!
The minimum is the dll and the corresponding import library. But the import library is compiler specific (dll must not be). So you can include a .def file, a text file that can be used to create an import library for the specific compiler of the user. There are more or less automatic ways to create a def file and an import library if you have only the dll.
|