在 Visual C++ 项目中使用 zlib [英] Using zlib in Visual C++ project

查看:54
本文介绍了在 Visual C++ 项目中使用 zlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力编译依赖 Zlib 的 Visual C++ 2010 项目.我有在 Linux 和 Mac OS X 上运行的源代码.这是我有链接器错误的地方:

I've been struggling to compile my Visual C++ 2010 project with dependency of Zlib. I've got source code that worked on Linux and Mac OS X. Here's, where I have linker errors:

error LNK2019: unresolved external symbol _inflate@8 referenced in function...
error LNK2019: unresolved external symbol _inflateInit2_@16 referenced in function...
error LNK2019: unresolved external symbol _deflate@8 referenced in function...
error LNK2019: unresolved external symbol _deflateInit2_@32 referenced in function...

我几天来一直在寻找解决方案,尝试以不同的方式编译 Zlib,但很明显我错过了一些东西.这里已经回答了非常相似的问题,但对于像我这样的业余爱好者来说还不够清楚.我需要逐步指导如何让它工作.

I've been finding solution for few days now, trying compiling Zlib different ways, but it is clear that I've missed something. Very similar question has been answered here, but not clearly enough for amateur like me. I would need step-by-step guide how to get it to work.

提前致谢.

推荐答案

如果您在构建 Zlib 后有静态库,请将它们指向您的项目中的此位置.项目属性 -> 链接器 -> 输入 -> 附加依赖项.给出绝对路径.

If you have static libraries after building the Zlib, point them in your project at this location.Project properties -> Linker -> Input -> Additional dependencies. Give the absolute path.

这篇关于在 Visual C++ 项目中使用 zlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆