0

so I have built and installed the MATIO library before, but without HDF5 and now I want to use it with HDF5 as I wish to work with newer versions of .mat files. So I downloaded pre-built HDF5 files for CMake and given the directory path when configuring the matio library, however when building I get the following error:

[  73%] Linking C shared library libmatio.dll
C:/PROGRA~1/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lzlib1
C:/PROGRA~1/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lszip
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [CMakeFiles\matio.dir\build.make:279: libmatio.dll] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:86: CMakeFiles/matio.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2

I never had this error when building the library without HDF5, but I can't see how this should be a problem, I have given the right directory path as advised. Any help would be appreciated it, thanks!

Bializm
  • 1
  • 4
  • Looks like you are missing a few a zlib dependency. Related: [https://stackoverflow.com/questions/25542055/mingw-c-compiler-zlib1-dll-missing-error](https://stackoverflow.com/questions/25542055/mingw-c-compiler-zlib1-dll-missing-error) – drescherjm May 04 '21 at 13:15
  • You may want to use msys2 [https://www.msys2.org/](https://www.msys2.org/) and install both zlib and szip using the package management in msys2: [https://packages.msys2.org/base/mingw-w64-szip](https://packages.msys2.org/base/mingw-w64-szip) and [https://packages.msys2.org/package/mingw-w64-x86_64-zlib](https://packages.msys2.org/package/mingw-w64-x86_64-zlib) – drescherjm May 04 '21 at 13:19
  • I just used msys2 to install both packages, but I sadly get the same error when using ```cmake --build .``` – Bializm May 04 '21 at 14:20
  • Did you switch your compiler to use the msys2 install instead of `C:/PROGRA~1/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/` it should be in `C:\msys64\mingw64` – drescherjm May 04 '21 at 14:47

0 Answers0