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