Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 1 | |
| 2 | VisualStudio instructions |
| 3 | |
Glenn Randers-Pehrson | b41a37d | 2014-06-06 18:25:09 -0500 | [diff] [blame^] | 4 | libpng version 1.6.12rc01 - June 6, 2014 |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 5 | |
| 6 | Copyright (c) 1998-2010 Glenn Randers-Pehrson |
| 7 | |
| 8 | This code is released under the libpng license. |
| 9 | For conditions of distribution and use, see the disclaimer |
| 10 | and license in png.h |
| 11 | |
| 12 | This directory contains support for building libpng under MicroSoft |
| 13 | VisualStudio 2010. It may also work under later versions of VisualStudio. |
| 14 | You should be familiar with VisualStudio before using this directory. |
| 15 | |
| 16 | Initial preparations |
| 17 | ==================== |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 18 | You must enter some information in zlib.props before attempting to build |
| 19 | with this 'solution'. Please read and edit zlib.props first. You will |
| 20 | probably not be familiar with the contents of zlib.props - do not worry, |
| 21 | it is mostly harmless. |
| 22 | |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 23 | This is all you need to do to build the 'release' and 'release library' |
| 24 | configurations. |
| 25 | |
| 26 | Debugging |
| 27 | ========= |
| 28 | The release configurations default to /Ox optimization. Full debugging |
| 29 | information is produced (in the .pdb), but if you encounter a problem the |
| 30 | optimization may make it difficult to debug. Simply rebuild with a lower |
| 31 | optimization level (e.g. /Od.) |
| 32 | |
Glenn Randers-Pehrson | 77396b6 | 2010-08-02 08:00:10 -0500 | [diff] [blame] | 33 | Linking your application |
| 34 | ======================== |
| 35 | Normally you should link against the 'release' configuration. This builds a |
Glenn Randers-Pehrson | 871b1d0 | 2013-03-02 14:58:22 -0600 | [diff] [blame] | 36 | DLL for libpng with the default runtime options used by Visual Studio 2010. |
| 37 | In particular the runtime library is the "MultiThreaded DLL" version. |
Glenn Randers-Pehrson | 77396b6 | 2010-08-02 08:00:10 -0500 | [diff] [blame] | 38 | If you use Visual Studio defaults to build your application you will have no |
| 39 | problems. |
| 40 | |
| 41 | If you don't use the Visual Studio defaults your application must still be built |
| 42 | with the default runtime option (/MD). If, for some reason, it is not then your |
Glenn Randers-Pehrson | 7455cbf | 2011-11-24 14:40:36 -0600 | [diff] [blame] | 43 | application will crash inside libpng16.dll as soon as libpng tries to read |
Glenn Randers-Pehrson | 77396b6 | 2010-08-02 08:00:10 -0500 | [diff] [blame] | 44 | from a file handle you pass in. |
| 45 | |
| 46 | If you do not want to use the DLL, for example for a very small application, |
| 47 | the 'release library' configuration may be more appropriate. This is built |
| 48 | with a non-standard runtime library - the "MultiThreaded" version. When you |
| 49 | build your application it must be compiled with this option (/MT), otherwise |
| 50 | it will not build (if you are lucky) or crash (if you are not.) |
| 51 | |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 52 | Stop reading here |
| 53 | ================= |
| 54 | You have enough information to build a working application. |
| 55 | |
| 56 | Debug versions have limited support |
| 57 | =================================== |
| 58 | This solution includes limited support for debug versions of libpng. You |
| 59 | do not need these unless your own solution itself uses debug builds (it is |
| 60 | far more effective to debug on the release builds, there is no point building |
Glenn Randers-Pehrson | 871b1d0 | 2013-03-02 14:58:22 -0600 | [diff] [blame] | 61 | a special debug build unless you have heap corruption problems that you can't |
| 62 | track down.) |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 63 | |
Glenn Randers-Pehrson | 810c2e6 | 2010-04-24 20:33:42 -0500 | [diff] [blame] | 64 | The debug build of libpng is minimally supported. Support for debug builds of |
| 65 | zlib is also minimal. You really don't want to do this. |