Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 1 | |
| 2 | VisualStudio instructions |
| 3 | |
Leon Scroggins III | 3cc83ac | 2017-10-06 11:02:56 -0400 | [diff] [blame] | 4 | libpng version 1.6.34 - September 29, 2017 |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 5 | |
Matt Sarett | 1146686 | 2016-02-19 13:41:30 -0500 | [diff] [blame] | 6 | Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 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 | ==================== |
| 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 | |
| 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 | |
| 33 | Linking your application |
| 34 | ======================== |
| 35 | Normally you should link against the 'release' configuration. This builds a |
| 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. |
| 38 | If you use Visual Studio defaults to build your application you will have no |
| 39 | problems. |
| 40 | |
Matt Sarett | 1146686 | 2016-02-19 13:41:30 -0500 | [diff] [blame] | 41 | If you don't use the Visual Studio defaults your application must still be |
| 42 | built with the default runtime option (/MD). If, for some reason, it is not |
| 43 | then your application will crash inside libpng16.dll as soon as libpng |
| 44 | tries to read from a file handle you pass in. |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 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 |
Matt Sarett | 1146686 | 2016-02-19 13:41:30 -0500 | [diff] [blame] | 50 | it will not build (if you are lucky) or crash (if you are not.) See the |
| 51 | WARNING file that is distributed along with this readme.txt. |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 52 | |
| 53 | Stop reading here |
| 54 | ================= |
| 55 | You have enough information to build a working application. |
| 56 | |
| 57 | Debug versions have limited support |
| 58 | =================================== |
| 59 | This solution includes limited support for debug versions of libpng. You |
| 60 | do not need these unless your own solution itself uses debug builds (it is |
| 61 | far more effective to debug on the release builds, there is no point building |
| 62 | a special debug build unless you have heap corruption problems that you can't |
| 63 | track down.) |
| 64 | |
| 65 | The debug build of libpng is minimally supported. Support for debug builds of |
| 66 | zlib is also minimal. You really don't want to do this. |
Matt Sarett | 1146686 | 2016-02-19 13:41:30 -0500 | [diff] [blame] | 67 | |
| 68 | WARNING |
| 69 | ======= |
| 70 | Libpng 1.6.x does not use the default run-time library when building static |
| 71 | library builds of libpng; instead of the shared DLL runtime it uses a static |
| 72 | runtime. If you need to change this make sure to change the setting on all the |
| 73 | relevant projects: |
| 74 | |
| 75 | libpng |
| 76 | zlib |
| 77 | all the test programs |
| 78 | |
| 79 | The runtime library settings for each build are as follows: |
| 80 | |
| 81 | Release Debug |
| 82 | DLL /MD /MDd |
| 83 | Library /MT /MTd |
| 84 | |
| 85 | NOTICE that libpng 1.5.x erroneously used /MD for Debug DLL builds; if you used |
| 86 | the debug builds in your app and you changed your app to use /MD you will need |
| 87 | to change it back to /MDd for libpng 1.6.0 and later. |
| 88 | |
| 89 | The Visual Studio 2010 defaults for a Win32 DLL or Static Library project are |
| 90 | as follows: |
| 91 | |
| 92 | Release Debug |
| 93 | DLL /MD /MDd |
| 94 | Static Library /MD /MDd |
| 95 | |
Alex Naidis | 7a055fd | 2016-10-01 12:23:07 +0200 | [diff] [blame] | 96 | Also, be sure to build libpng, zlib, and your project all for the same |
| 97 | platform (e.g., 32-bit or 64-bit). |