开发者

uncompress from zlib.h - error - undefined reference to `uncompress_gzip'

开发者 https://www.devze.com 2023-02-13 00:10 出处:网络
I have code in which, I have got compressed data and I need to uncompress it. I am using zlib for this

I have code in which, I have got compressed data and I need to uncompress it. I am using zlib for this I have done:

#include <开发者_Go百科;zlib.h>

in my .cpp file. Now, when I compile it, I get the error: undefined reference to `uncompress_gzip'

Do, I need to link with some lib?

Thanks, sg


You need to link it to zlib. Without knowing what compiler you are using, I'll just use GCC:

gcc my.cpp -lz
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号