Re: [netcdfgroup] Building netcdf-4.2 on Windows

Roy

Back to your original post

My current efforts show that a 32-bit build chokes on hsize_t:

libsrc4\nc4hdf.c(2050): error C2275: 'hsize_t' : illegal use of this type as an expression
1> c:\lib\hdf5-1.8.8\src\H5public.h(151) : see declaration of 'hsize_t'

I started the "libsrc4" implementation with Visual Studio 2010, and it seems to me that the fix for this error is as simple as moving the
variable declaration "hsize_t num_obj;" 2 lines up :)


This is line 2050 of  libsrc4/nc4hdf.c

original code is

static int
var_exists(hid_t grpid, char *name, int *exists)
{
   var_exists_iter_info iter_info;
   iter_info.name = name;
   iter_info.exists = exists;
   hsize_t num_obj;        <------------ error here


change to

static int
var_exists(hid_t grpid, char *name, int *exists)
{
   var_exists_iter_info iter_info;
   hsize_t num_obj;             <------------ move up
   iter_info.name = name;
   iter_info.exists = exists;


This took me a while to find out, lately I have been doing more C++ than C;
The error is just because in C the declaration of variables must be done
first; at least in strict ANSI C

I did not try yet to compile in Linux, apparently gcc tolerates this with the gcc flags of the project (that probably are not -ansi );
but Visual Studio 2010 does not.

http://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards

Note : consider this fix as "just compiles" for now.

Pedro





----- Original Message ----- From: Pedro Vicente
To: netcdfgroup@xxxxxxxxxxxxxxxx ; Roy Dennington
Cc: Charlie Zender
Sent: Friday, April 27, 2012 2:17 AM
Subject: Re: [netcdfgroup] Building netcdf-4.2 on Windows


Roy

I know this is a broken record, but has anyone successfully built netcdf-4.2 on Windows? Any help is greatly appreciated.


I am in the process of building netcdf 4.2 with Visual Studio 2010.

There is a working prototype at

http://www.space-research.org/

click on the "netcdf" menu and downlod the zip file.

disclaimer: by "working" I mean that at this time, it compiles, links the
classic netcdf library and builds ncdump.

I started from scratch and I did not use the existing /win32/NET solution
for a Visual Studio 2008 DLL.

I built Qt project files (.pro) by using the source and header files listed
in the Makefile.am files ( that is, copying the source files in each
Makefile.am to the corresponding Qt project file ".pro")

Qt is a framework for building cross platform GUIs

http://qt.nokia.com/products/

so, there are also Qt projects in the .zip

I used Qt because it has a plugin to generate a Visual Studio solution from
the QT project ".pro" files;
this was the way the Visual Studio solution was made.

the solution has the projects:

/libsrc
/libdispatch
/ncdump

each one of these folders contains the Qt projects as well the Visual Studio
projects.

the solution file is "netcdf.sln" at root

Qt has its own IDE called QtCreator that opens the "netcdf.pro" file
located at root ( I did not try it with QtCreator though ).

I used a modified version of "config.h" at /win32/NET/config.h

changes made were:

/* #define DLL_NETCDF 1 */


I added these definitions that are also in ncconfigure.h, that seemed not to
be included anywhere in the source files


/* from ncconfigure.h */
typedef unsigned char uchar;
typedef unsigned long long ulonglong;
typedef unsigned int uint;

#define nulldup(s) ((s)==NULL?NULL:strdup(s))

I added "getopt.c" in /win32/NET/getopt.c to the project

these are the only items needed from  /win32/NET

I will be updating this solution for a "full" port in the near future;

anyone feel free to send comments or suggestions :)

Pedro


----------------------
Pedro Vicente
pedro.vicente@xxxxxxxxxxxxxxxxxx
http://www.space-research.org/




----- Original Message ----- From: Roy Dennington
To: netcdfgroup@xxxxxxxxxxxxxxxx
Sent: Wednesday, March 21, 2012 5:15 PM
Subject: [netcdfgroup] Building netcdf-4.2 on Windows


All,

I know this is a broken record, but has anyone successfully built netcdf-4.2
on Windows?  Any help is greatly appreciated.  I need a very basic build:
no DAP, no curl, no parallel, dll.  I am desperate.  I have not attempted a
build since the refactor (4.1.1).

My current efforts show that a 32-bit build chokes on hsize_t:

libsrc4\nc4hdf.c(2050): error C2275: 'hsize_t' : illegal use of this type as
an expression
1>          c:\lib\hdf5-1.8.8\src\H5public.h(151) : see declaration of
'hsize_t'

typedef unsigned long long       hsize_t;

I tried both VS 2010 and Intel compilers.

Kind Regards,
Roy Dennington




_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit:
http://www.unidata.ucar.edu/mailing_lists/

_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/


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