rogersce / cnpy

library to read/write .npy and .npz files in C/C++
MIT License
1.34k stars 301 forks source link

usage at the platform of windows #60

Closed mwsunshine closed 4 years ago

mwsunshine commented 4 years ago

hi,

Thank you for your great work! I notice your guideline for installation is for linux. Is it possible to use this lib on windows?

best wishes,

Matthew

sutongkui commented 4 years ago

I just copied the .h and .cpp to my project(in a visual studio project), and met the compile error,

`1>cnpy.obj : error LNK2019: unresolved external symbol inflate referenced in function "struct cnpy::NpyArray __cdecl load_the_npz_array(struct _iobuf *,unsigned int,unsigned int)" (?load_the_npz_array@@YA?AUNpyArray@cnpy@@PEAU_iobuf@@II@Z)

1>cnpy.obj : error LNK2019: unresolved external symbol inflateEnd referenced in function "struct cnpy::NpyArray __cdecl load_the_npz_array(struct _iobuf *,unsigned int,unsigned int)" (?load_the_npz_array@@YA?AUNpyArray@cnpy@@PEAU_iobuf@@II@Z)

1>cnpy.obj : error LNK2019: unresolved external symbol inflateInit2_ referenced in function "struct cnpy::NpyArray __cdecl load_the_npz_array(struct _iobuf *,unsigned int,unsigned int)" (?load_the_npz_array@@YA?AUNpyArray@cnpy@@PEAU_iobuf@@II@Z)`

Lala5th commented 4 years ago

Looks like you are missing Zlib, though I am not 100% sure. To the initial question: I think if you can use cmake on windows you can still use the install directions(mostly) and you can link the libraries, but I had no experience with cmake on windows so I am unsure

sutongkui commented 4 years ago

you are right, i installed zlib and it works well.