NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdf-porting] NetCDF and Visual Studio 2008

NOTE: The netcdf-porting mailing list is no longer active. The list archives are made available for historical reasons.

Hi,

I am trying to compile NetCDF under Visual Studio 2008 Prof. (aka VS
9.0). Yes, I know: every new version of Visual Studio has new
surprises. I attach notes with details of the problems I encountered.

I tried the current 4.0 stable build as well as the daily snapshots of
NetCDF 3 and 4. As I am still unable to compile the library I will use
the last available binaries: for NetCDF 3.6.1. However, I have a
couple of suggestions, if that is ok:

- The win32 binaries were not easy to find. It would seem logical to
put the link on the page where other (non-Windows) people can download
their binaries.

- It would be nice if you made newer builds available. I use VS 2008,
but if you can compile NetCDF 4.0 with VS 2005, I could use the
resulting library.

- New versions of Visual C++ (incl. 2008) are available for free from
msdn.microsoft.com, as so-called "express editions". The express
version does not have all the features of prof. edition, but it should
be ok for testing the distribution.

- I wanted to compile from the command line, but I do not know how to.
There is no "makefile", and Microsoft's nmake would not accept
makefile.in as input. In any case, command-line compilation might
prove more resilient to Microsoft's ever-changing ideas on how to
improve their build system.

Thanks and best wishes,

Maciej.
Buidling NetCDF under VS 2008.
I tried: NetCDF 4.0 (stable) and development snapshots: 
netcdf-3.6.3-snapshot2008080506, netcdf-4.0-snapshot2008073106.
Here is the detailed description of the problems and some workarounds.


1. VS converted the sln file to the new version. I removed the /Wp64 compiler 
option (deprecated).

2. I got errors resulting from the definition

typedef long _off_t

in <sys/types.h>. This issue was previously dicussed on the list. I resolved it 
by addin the lines:

#ifndef _OFF_T_DEFINED
typedef long _off_t;                    /* file offset value */
#define _OFF_T_DEFINED
#endif

before #include <sys/types.h> in nc.h.


3. Some include files where missing:

inttypes.h
unistd.h

I got inttypes.h and a compatible stdint.h from wikipedia. I created an empty 
unistd.h.
I got this problem in the stable 4.0 release, and then, since I already had the 
files in standard directories, it did not come up anymore.


4. I had to replace:

extern char *sys_errlist[];

with

extern char **sys_errlist;

in the definition of strerror(int errnum) in error.c.


5. I am still getting unresolved externals:

_utf8proc_NFC
_utf8proc_check

I do not know how to deal with them.

  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-porting archives: