Install libpng on Windows

compile libpng.lib

libpng is the library to give the approach to png read&write.

libpng uses zlib to complete the compress&uncompress job, so the we assume the zlib has installed previously.

 

1. make sure  that the directory zlib and the directory png locating under the same folder.

2. select the right make file in png/scripts to compile, e.g. on window with vs/vc to compile, you should choose makefile.vcwin32(copy it to the folder png) to build with the command "nmake makefile.vcwin32" (you'd better to run it in vs procmd),

then the libpng.lib is generated in folder png.

 

use the libpng.lib

As libpng need zlib to do the compress stuff, you should reference the libzlib.lib also whenever you use the libpng.lib.

 

Be aware that, there are different approach to load static lib in vc6.0 and vs2005:

In vc6.0, you just need to add the whole absolute path of the referenced lib to the project setting, e.g. C:/MyLib/lipng.lib;

 

but in vs2005, you could only set the directory where the necessary lib locates, so you should search the necessary lib in your code before using it, e.g. add the codes :

 

the same as the reference to libzlib.lib.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值