README.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Expat can be built on Windows in two ways:
  2. using MS Visual Studio .NET or Cygwin.
  3. * Cygwin:
  4. This follows the Unix build procedures.
  5. * MS Visual Studio 2013, 2015 and 2017:
  6. A solution file for Visual Studio 2013 is provided: expat.sln.
  7. The associated project files (*.vcxproj) reside in the appropriate
  8. project directories. This solution file can be opened in VS 2015 or VS 2017
  9. and should be upgraded automatically if VS 2013 is not also installed.
  10. Note: Tests have their own solution files.
  11. * All MS C/C++ compilers:
  12. The output for all projects will be generated in the win32\bin
  13. directory, intermediate files will be located in project-specific
  14. subdirectories of win32\tmp.
  15. * Creating MinGW dynamic libraries from MS VC++ DLLs:
  16. On the command line, execute these steps:
  17. pexports libexpat.dll > expat.def
  18. pexports libexpatw.dll > expatw.def
  19. dlltool -d expat.def -l libexpat.a
  20. dlltool -d expatw.def -l libexpatw.a
  21. The *.a files are mingw libraries.
  22. * Special note about MS VC++ and runtime libraries:
  23. There are three possible configurations: using the
  24. single threaded or multithreaded run-time library,
  25. or using the multi-threaded run-time Dll. That is,
  26. one can build three different Expat libraries depending
  27. on the needs of the application.
  28. Dynamic Linking:
  29. By default the Expat Dlls are built to link statically
  30. with the multi-threaded run-time library.
  31. The libraries are named
  32. - libexpat(w).dll
  33. - libexpat(w).lib (import library)
  34. The "w" indicates the UTF-16 version of the library.
  35. One rarely uses other versions of the Dll, but they can
  36. be built easily by specifying a different RTL linkage in
  37. the IDE on the C/C++ tab under the category Code Generation.
  38. Static Linking:
  39. The libraries should be named like this:
  40. Single-theaded: libexpat(w)ML.lib
  41. Multi-threaded: libexpat(w)MT.lib
  42. Multi-threaded Dll: libexpat(w)MD.lib
  43. The suffixes conform to the compiler switch settings
  44. /ML, /MT and /MD for MS VC++.
  45. Note: In Visual Studio 2005 (Visual C++ 8.0) and later, the
  46. single-threaded runtime library is not supported anymore.
  47. By default, the expat-static and expatw-static projects are set up
  48. to link statically against the multithreaded run-time library,
  49. so they will build libexpatMT.lib or libexpatwMT.lib files.
  50. To build the other versions of the static library,
  51. go to Project - Settings:
  52. - specify a different RTL linkage on the C/C++ tab
  53. under the category Code Generation.
  54. - then, on the Library tab, change the output file name
  55. accordingly, as described above
  56. An application linking to the static libraries must
  57. have the global macro XML_STATIC defined.