[MINC-users] minc2 api question - miget_volume_dimensions

EJ Nikelski nikelski at bic.mni.mcgill.ca
Wed Aug 5 18:20:39 EDT 2009


Hi all,

   Ok, when I went to college, we were taught Cobol and RPG, and ever
since, I've been struggling with pointers.  I am coding a call to
miget_volume_dimensions (minc2 API), and when I allocate the
dimensional information to the stack, it all works fine.  If, however,
I want to get fancy and allocate to the heap, I get a heap load of
trouble from the compiler (default Apple gcc on 10.5).  For example,
consider:

midimhandle_t		*dimensions;    // declare pointer

/* get the dimension info for all dimensions*/
dimensions = (midimhandle_t) malloc( sizeof(struct midimhandle_t) *
nDimensions );
result = miget_volume_dimensions(minc_volume, MI_DIMCLASS_ANY,
MI_DIMATTR_ALL, MI_DIMORDER_FILE, nDimensions, dimensions);

  I get a compiler error on the malloc line:

minc2_io.c:141: error: invalid application of ‘sizeof’ to incomplete
type ‘struct midimhandle_t’
minc2_io.c:141: warning: assignment from incompatible pointer type

  I am willing to bet real money that I'm doing something
embarrassingly stupid.  Any ideas?

-Jim

-- 
=================================
Jim Nikelski, Ph.D.
Postdoctoral Research Fellow
Bloomfield Centre for Research in Aging
Lady Davis Institute for Medical Research
Sir Mortimer B. Davis - Jewish General Hospital
McGill University



More information about the MINC-users mailing list