[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [netcdf-porting] avoiding MSC_EXTRA definition
- To: dennis neal <neon10@xxxxxxxxxxx>
- Subject: Re: [netcdf-porting] avoiding MSC_EXTRA definition
- From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
- Date: Thu, 01 May 2008 15:16:10 -0600
- Cc: support-netcdf@xxxxxxxxxxxxxxxx
- Delivered-to: support-netcdf@unidata.ucar.edu by laraine.unidata.ucar.edu (Postfix) with ESMTP id 540F6CB184; Thu, 1 May 2008 15:16:10 -0600 (MDT)
- In-reply-to: <BAY108-W386FCF93527E344536017DC4DB0@phx.gbl> (dennis neal's
- References: <BAY108-W3603B08C9EAB236FCCA16EC4D80@phx.gbl> <sadbq3q834m.fsf@shecky.unidata.ucar.edu> <BAY108-W386FCF93527E344536017DC4DB0@phx.gbl>
- User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
dennis neal <neon10@xxxxxxxxxxx> 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 -- ed@xxxxxxxxxxxxxxxx