Earnie Boyd <earnie@...> writes:
> Quoting Ed <ejh@...>:
> > 1 - Any clue why libtool gives me a DLL named libnetcdf-0.dll instead
> > of libnetcdf.dll? I am just renaming this to libnetcdf.dll anyway.
> Libtool smartly versions the libraries so that when you upgrade all of
> the binaries don't need to be upgraded at the same time. See the
> libtool documentation and lists.
The libtool documentation mentions little about dlls, and, as far as I
can find, make no mention of why libtool is giving my dlls this
name. A search of the libtool mailing list archives has not turned up
any helpful answer either. So I am still confused about why the "-O"
is added to this library name.
I don't understand what you mean about all the binraries being
upgraded at the same time. Surely that's what I want when upgrading?
> > 2 - Shouldn't the name be netcdf.dll anyway?
> No, libnetcdf.dll will be found by GCC as the library to link with in
> it's search for libraries. The import library isn't needed if the dll
> is used instead. This matches the UNIX scenarios. Again see the
> libtool documentation and lists.
Ummm, wouldn't gcc want to use libnetcdf.a?
Actually I don't understand why MinGW is using the DLL. How come it
doesn't use libnetcdf.a, which also is produced, instead of the DLL?
The unix side doesn't use the export library either, does it? I don't
remember ever using a *.lib file in unix, just the .h and the .a. Or
have I just been missing something that's going on in the background?
When I look at how the test program is compiled, I see that it *is*
using the .lib file. I am investigating further...
If you can refer to a specific place in the docs or mailing lists,
that would be more helpful. Nothing is jumping out at me. I already
checked these sources before posting, and checking again now I still
am not finding any answers there.
Of course, there is a lot of material, and perhaps I am looking in the
wrong places. Certainly I am willing to believe that all of this is
documented *somewhere*. ;-) But where?
As for this DLL name, my understanding is that I *need* to call it
netcdf.dll, because that is what previous versions (built with visual
studio) have been called. In order for user programs to get the latest
version of the DLL, it has to have the same name, correct? Also, if I
changed the name, all users would have to change their program
configurations to use the new versions. Not good.
> > 3 - When I run "make check" of netCDF, under MinGW, it fails with a
> > windows message box telling me that libnetcdf.dll could not be
> > found. I copied libnetcdf.dll to /windows/system32, and tried again,
> > and it worked. Fine, but how am I supposed to handle this as a
> > distribution? Install the dll before running the tests on the user
> > machine? That seems crazy!
> You need to modify the tests Makefile to add a path to where the built
> library lives to PATH or copy the dll to the test directory.
OK, thanks, the PATH idea seems like the way to proceed.
However I also realize that, if I want to be able to build and test a
DLL on MinGW, I will also need to have my makefile call the MS "lib"
program to make the MS export library from the .def file...
> > 4 - What files should be included in the binary distribution to the
> > netcdf developer? Obviously netcdf.h, netcdf.dll, and netcdf.lib. Any
> > other ones? When installed, netcdf.dll should go in /windows/system32,
> > but where should the others go?
> What is included with a UNIX build? It sounds reasonable that
> netcdf.h, libnetcdf.dll and netcdf.lib are what is included.
There is no .lib file in Unix distributions, just the .h and the .a
> You stated that you were using VStudio; have you tried MSYS which gives
> you a minimal UNIX shell with a mingw32 build environment? Then you
> execute configure --prefix=`cd /mingw && pwd -W` to build using GCC.
Yes, I am actually using MSYS/MinGW to build the DLL; I'm just testing
it in visual studio.
That is, I build the dll with MinGW, use MS's tool to generate the
.lib file from the .def file that MinGW has generated, and the use
visual studio to write a console app which uses the DLL, to make sure
I got something that Windows programmers can use in visual studio.
There are also a bunch of tests with the build, which are not run in
visual studio, but are run when I do "make check" from MSYS. So I need
it to work both from the MSYS command line and from within visual
Thanks for all the answers!