Download the latest source code from http://www.zlib.net/
Zlib provides a vs SLn file in the zlib-1.2.8\contrib\vstudio\ directory that has
Where the Zlibstat is compiled into a static library
ZLIBVC is compiled into a dynamic library, and there are other projects that have not been studied for the time being
Compiling on Windows will succeed.
There is a project called Zlib, an error occurred
zconf.h cannot open include file: ' Unistd.h ': No such file or directory
Read some notes and say you can do this:
If you ' re using ZLIB in your project and then you need to find:
#if 1
In Zconf.h and replace (uncomment) it with:
#if have_unistd_h/* ... the rest of the line
If it isn ' t ZLib I guess you should find some alternative a-do. Gl.
Reference: http://www.360doc.com/content/13/0124/17/1200324_262179628.shtml
VC Create Win32 Project, in]win32 down with zlib library function compress compile error (Error LNK2019: unresolved external symbol _compress?
Answer: Add zlib 1.2.5 to your project, compile with two points to note
1. is zlib 1.2.5 source code package in \contrib\vstudio\readme.txt said in the use of zlib to predefined macros Zlib_wiNAPI, otherwise it could not be compiled through.
-To use Zlibwapi.dll in your application, you must define the macro Zlib_winapi when compiling your application ' s source Files.
2. When linking, in addition to #pragma comment (lib, "Zlibvc.lib") to add the introduction of the library, but also note that the settings of the character set to be unified. Otherwise, there will be a link error, which indicates that the _compress external variable could not be found.
I am in the project properties->c++-> predefined macro---preprocessor definition. Add ZLIB_WINAPI This macro, and then link will be just fine.
Http://blog.csdn.net/xiabodan/article/details/38391171?utm_source=tuicool&utm_medium=referral
Http://blog.sina.com.cn/s/blog_96ea53fb0101ldd9.html
Zlib Compiling and installing