[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [netcdf-porting] avoiding MSC_EXTRA definition
- Subject: Re: [netcdf-porting] avoiding MSC_EXTRA definition
- Date: Thu, 01 May 2008 15:16:10 -0600
dennis neal <address@hidden> writes:
> Ed:
>
> Yes, I ran the configure script. I discovered that the easiest way
> to get the dictionary file was to run configure, then move config.h
> and the libsrc *.c files into the cxx directory. That contains then
> all files needed to compile the C++ interface.
What environment are you trying to build in?
> But I dont see where in config.h that the DLL is defined, so that I
> can make sure that it is turned off. I'm not a C programmer, but
> dont see it.
In config.h:
/* set this only when building a DLL under MinGW */
/* #undef DLL_NETCDF */
In netcdf.h:
/* Declaration modifiers for DLL support (MSC et al) */
#if defined(DLL_NETCDF) /* define when library is a DLL */
# if defined(NC_DLL_EXPORT) /* define when building the library */
# define MSC_EXTRA __declspec(dllexport)
# else
# define MSC_EXTRA __declspec(dllimport)
# endif
#include <io.h>
#define lseek _lseeki64
#define off_t __int64
#define stat __stat64
#define fstat _fstat64
#else
#define MSC_EXTRA
#endif /* defined(DLL_NETCDF) */
# define EXTERNL extern MSC_EXTRA
/* When netCDF is built as a DLL, this will export ncerr and
* ncopts. When it is used as a DLL, it will import them. */
#if defined(DLL_NETCDF)
MSC_EXTRA int ncerr;
MSC_EXTRA int ncopts;
#endif
>
> I need the V2 interface for AIA ANDI, so I must have it. I see some
> V2 stuff buried in the EXTERNL stuff, so dont want to just erase
> from MSC_EXTRA on down.
>
> The netcdf.so for ROOT can be created and loaded, but then when
> trying to load a C or C++ file to test it, the ROOT interpreter
> warns of the undefined MSC_EXTRA and stops.
>
> I need to know how to make sure that all MSC_EXTRA and EXTERNL
> things are not compiled.
In non-DLL builds, MSC_EXTRA is defined to nothing, and EXTERNL to
extern.
Good luck.
Ed
--
Ed Hartnett -- address@hidden