Install libpng environment under Mac

Source: Internet
Author: User

Using go to write a crawler tool need to use a go library, and this library need to use the Libpng library, or compile will be prompted to say that png.h can not find such information, so think should and windows need to install the GCC environment, and then let the GCC installed libpng this library,

Workaround:

Terminal input ' gcc-v ' found that the Mac default is the GCC environment, but there is no libpng this library, so according to the method on the Internet, first install a call brew environment, directly in the terminal input:

Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

To start the installation, you may need to FQ, wait for the brew to be installed, and enter in the terminal:

Brew Install Libpng

It's OK.

Compiling the Go program you wrote again was a success.

Brew has its own variety of commands, in addition to the steel install, there are:

Brew List

You can see which libraries have been installed locally. Wait a minute.

Install libpng environment under Mac

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.