rogersce / cnpy

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

Undefined reference to crc32 error when compiling #13

Closed Quasimondo closed 7 years ago

Quasimondo commented 8 years ago

When trying to compile a program that uses the cnpy::npz_save method I got an "undefined reference to `crc32'" error, which I did not get when using the cnpy::npy_save method.

I could resolve this by adding -lz to the g++ compilation line, so it looks like this: g++ test.cpp -L/usr/local/lib -lcnpy -lz -o test

Just wanted to add this here in case other run into the same issue.

han-qiu commented 8 years ago

@Quasimondo Thank you! Solved my problem.

rogersce commented 7 years ago

Thank you for pointing this out. I've updated the README to reflect this.

immaraj commented 5 years ago

Thanks, this helped me.

kumar-saurabh2 commented 4 years ago

When trying to compile a program that uses the cnpy::npz_save method I got an "undefined reference to `crc32'" error, which I did not get when using the cnpy::npy_save method.

I could resolve this by adding -lz to the g++ compilation line, so it looks like this: g++ test.cpp -L/usr/local/lib -lcnpy -lz -o test

Just wanted to add this here in case other run into the same issue.

Thank you so much! I also faced similar issue of `crc32' and it was fixed by adding -lz

bored17 commented 2 years ago

i love you