[MINC-users] redefinitions in volume_io/basic.h, multidim.h causing compilation errors on Windows

Steven Robbins steve at sumost.ca
Mon Sep 22 03:17:22 EDT 2008


On Thu, Sep 18, 2008 at 06:20:42PM -0700, Andrew Janke wrote:
> > There is a #define that turns this 'on' but I am currently mobile so
> > can't dig it up.
>
> Found it.
>
> Check that "VIO_PREFIX_NAMES" is defined as 1.
>
> If it is then we have some work to do.. :)

It's not going to help.  The offending code (below, from basic.h) is
NOT conditional on VIO_PREFIX_NAMES.

typedef enum {
               OK,
               ERROR,
               INTERNAL_ERROR,
               END_OF_FILE,
               QUIT
             } VIO_Status;

The enum VIO_Data_types in multidim.h, which has the offending enum
value "DOUBLE", is similar.

In the past, I've worked around this kind of problem by partitioning
my code so that a given file never needs to include conflicting
headers.

Some things to try:

 * Move includes from the .h file into the .c file.
 * If you need a type in the .h that is only passed around by
   pointers, you can use a forward declaration to avoid #including the
   header defining it.
 * Creating a type that encapsulates the volume_io type can help achieve
   the first two points.

Cheers,
-Steve


More information about the MINC-users mailing list