Zlib Compiling and installing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.