README.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Instructions for building libpng using Microsoft Visual Studio
  2. ==============================================================
  3. Copyright (c) 2018 Cosmin Truta
  4. Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson
  5. This code is released under the libpng license.
  6. For conditions of distribution and use, see the disclaimer and license
  7. in png.h
  8. This directory contains a solution for building libpng under Microsoft
  9. Visual Studio 2010. It may also work under later versions of Visual
  10. Studio. You should be familiar with Visual Studio before using this
  11. solution.
  12. Initial preparations
  13. --------------------
  14. You must enter some information in zlib.props before attempting to
  15. build with this 'solution'. Please read and edit zlib.props first.
  16. You will probably not be familiar with the contents of zlib.props -
  17. do not worry, it is mostly harmless.
  18. This is all you need to do to build the 'release' and 'release library'
  19. configurations.
  20. Debugging
  21. ---------
  22. The release configurations default to /Ox optimization. Full debugging
  23. information is produced (in the .pdb), but if you encounter a problem
  24. the optimization may make it difficult to debug. Simply rebuild with a
  25. lower optimization level (e.g. /Od.)
  26. Linking your application
  27. ------------------------
  28. Normally you should link against the 'release' configuration. This
  29. builds a DLL for libpng with the default runtime options used by Visual
  30. Studio. In particular the runtime library is the "MultiThreaded DLL"
  31. version. If you use Visual Studio defaults to build your application,
  32. you should have no problems.
  33. If you don't use the Visual Studio defaults your application must still
  34. be built with the default runtime option (/MD). If, for some reason,
  35. it is not then your application will crash inside libpng16.dll as soon
  36. as libpng tries to read from a file handle you pass in.
  37. If you do not want to use the DLL, and prefer static linking instead,
  38. you may choose the 'release library' configuration. This is built with
  39. a non-standard runtime library - the "MultiThreaded" version. When you
  40. build your application, it must be compiled with this option (/MT),
  41. otherwise it will not build (if you are lucky) or it will crash (if you
  42. are not.) See the WARNING file that is distributed with this README.
  43. Stop reading here
  44. -----------------
  45. You have enough information to build a working application.
  46. Debug versions have limited support
  47. -----------------------------------
  48. This solution includes limited support for debug versions of libpng.
  49. You do not need these unless your own solution itself uses debug builds
  50. (it is far more effective to debug on the release builds, there is no
  51. point building a special debug build unless you have heap corruption
  52. problems that you can't track down.)
  53. The debug build of libpng is minimally supported. Support for debug
  54. builds of zlib is also minimal. Please keep this in mind, if you want
  55. to use it.
  56. WARNING
  57. -------
  58. Libpng 1.6.x does not use the default run-time library when building
  59. static library builds of libpng; instead of the shared DLL runtime, it
  60. uses a static runtime. If you need to change this, make sure to change
  61. the setting on all the relevant projects:
  62. libpng
  63. zlib
  64. all the test programs
  65. The runtime library settings for each build are as follows:
  66. Release Debug
  67. DLL /MD /MDd
  68. Library /MT /MTd
  69. Also, be sure to build libpng, zlib, and your project, all for the same
  70. platform (e.g., 32-bit or 64-bit).