README.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 2022:
  6. Use CMake to generate a solution file for Visual Studio, then use msbuild
  7. to compile. For example:
  8. md build
  9. cd build
  10. cmake -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
  11. msbuild /m expat.sln
  12. * All MS C/C++ compilers:
  13. The output for all projects will be generated in the <CMAKE_BUILD_TYPE>\
  14. and xmlwf\<CMAKE_BUILD_TYPE>\ directories.
  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 dynamically
  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. Versions that are statically linking with the multi-threaded run-time library
  36. can be built with -DEXPAT_MSVC_STATIC_CRT=ON.
  37. Static Linking: (through -DEXPAT_SHARED_LIBS=OFF)
  38. The libraries should be named like this:
  39. Multi-threaded: libexpat(w)MT.lib
  40. Multi-threaded Dll: libexpat(w)MD.lib
  41. The suffixes conform to the compiler switch settings
  42. /MT and /MD for MS VC++.
  43. An application linking to the static libraries must
  44. have the global macro XML_STATIC defined.