I am trying to use zlib functions while working with poco c++ library. Linking to the zlib library directly does not work, because poco links to it also and I get several duplicates while linking. So I removed zlib.lib from my libraries list and used the poco version only.

Because zlib.h is part of poco, compiling works perfectly, but linking now results in the following error

error LNK2019 unresolved external "_gzopen" 

So I can switch between duplicate and unresolved. Who can help me out?

有帮助吗?

解决方案

On windows, defining ZLIB_DLL should force export of native zlib interface. Optionally, Poco InflatingStream and DeflatingStream wrap zlib functionality. A word of warning: these are std streams derivatives and there may be a performance penalty.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top