tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
341 stars 97 forks source link

Mat_VarGetStructFieldByName doesn't work with HDF library above 1.8.16 #90

Closed charlestamz closed 6 years ago

charlestamz commented 6 years ago

Hey, guys I have found an issue that related to the higher version of hdf library (above 1.8.16). My code snipper is like :

                    matvar_t * shrink = Mat_VarGetStructFieldByName(pChnsfield, "shrink", 0);
                    assert(shrink != NULL);
                    paraPyr.chnsParas.shrink = *((double *) shrink->data); //shrink->data becomes null with 1.8.19 or 1.8.20 hdf library

this code works perfectly with version1.8.16 of hdf library.
But it doesn't work with 1.8.19 or later version of hdf library. I spent some time debugging but haven't found out the reason. Hope you can give me some help. Thanks. Charles Tamz

tbeu commented 6 years ago

I need more information, since I see that Mat_VarGetStructFieldByName performs on the testsuite as expected.

  1. How dou generate the MAT file? In MATLAB or using matio? If matio, which version and which HDF5 version do you use. If HDF5, do you use pre-compiled or self-compiled binaries?
  2. Please attach a test MAT file and some C/C++ file I can run and debug to reproduce the observed behaviour!