VS compile libpng and zlib

Source: Internet
Author: User

Libpng for image processing, zlib for compression. The two are closely related, libpng depend on zlib.


Compile the library:

1. Download libpng (http://sourceforge.net/projects/libpng/files/) and Libz (http://zlib.net/zlib-1.2.7.tar.gz) First, unzip the libpng, such as C:\workspace\libpng\.

2. Unzip Libz, rename zlib to libpng sibling directory, such as C:\workspace\zlib.

3. Enter libpng\projects\visualc71\ and open the project file with Visual Studio, there will be three sub-projects in the scheme: libpng, Pngtest, zlib. Direct compilation, no accident will be in the Win32_dll_debug directory and Win32_dll_debug\zlib directory generated Zlib1d.dll, Libpng15d.dll, libpng.lib and Zlib.lib library files.

4. If the error, copy scripts/pnglibconf.h.prebuilt to the source directory, renamed to Pnglibconf.h


There are three main things you need to do to work with these two libraries:

1. Add a directory containing Png.h and other header files to the add-in directory in the general

2. Add Zlib.lib;libpng.lib in additional dependencies, input, linker.

3. Common Properties->vc++ Directory---the library directory with Zlib.lib and Libpng.lib added.

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.