2002-10-21 17:19:41 -04:00
|
|
|
|
2017-04-25 17:08:58 -04:00
|
|
|
Expat can be built on Windows in two ways:
|
2017-04-25 17:11:48 -04:00
|
|
|
using MS Visual Studio .NET or Cygwin.
|
2002-10-21 17:19:41 -04:00
|
|
|
|
|
|
|
* Cygwin:
|
|
|
|
This follows the Unix build procedures.
|
|
|
|
|
2017-06-17 12:05:48 -04:00
|
|
|
* MS Visual Studio 2013, 2015 and 2017:
|
2019-08-28 19:36:55 -04:00
|
|
|
Use CMake to generate a solution file for Visual Studio, then use msbuild
|
|
|
|
to compile. For example:
|
|
|
|
|
|
|
|
md build
|
|
|
|
cd build
|
|
|
|
cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
|
|
|
|
msbuild /m expat.sln
|
2007-05-03 20:17:18 -04:00
|
|
|
|
|
|
|
* All MS C/C++ compilers:
|
2019-08-28 19:36:55 -04:00
|
|
|
The output for all projects will be generated in the <CMAKE_BUILD_TYPE>\
|
|
|
|
and xmlwf\<CMAKE_BUILD_TYPE>\ directories.
|
2005-11-28 13:42:49 -05:00
|
|
|
|
|
|
|
* Creating MinGW dynamic libraries from MS VC++ DLLs:
|
|
|
|
|
|
|
|
On the command line, execute these steps:
|
|
|
|
pexports libexpat.dll > expat.def
|
|
|
|
pexports libexpatw.dll > expatw.def
|
|
|
|
dlltool -d expat.def -l libexpat.a
|
|
|
|
dlltool -d expatw.def -l libexpatw.a
|
|
|
|
|
|
|
|
The *.a files are mingw libraries.
|
2002-10-21 17:19:41 -04:00
|
|
|
|
2002-12-07 09:18:50 -05:00
|
|
|
* Special note about MS VC++ and runtime libraries:
|
2002-10-21 17:19:41 -04:00
|
|
|
|
|
|
|
There are three possible configurations: using the
|
|
|
|
single threaded or multithreaded run-time library,
|
|
|
|
or using the multi-threaded run-time Dll. That is,
|
|
|
|
one can build three different Expat libraries depending
|
|
|
|
on the needs of the application.
|
|
|
|
|
2002-12-07 09:18:50 -05:00
|
|
|
Dynamic Linking:
|
|
|
|
|
2019-08-29 15:20:15 -04:00
|
|
|
By default the Expat Dlls are built to link dynamically
|
2003-10-23 20:40:54 -04:00
|
|
|
with the multi-threaded run-time library.
|
|
|
|
The libraries are named
|
2002-12-07 09:18:50 -05:00
|
|
|
- libexpat(w).dll
|
|
|
|
- libexpat(w).lib (import library)
|
|
|
|
The "w" indicates the UTF-16 version of the library.
|
|
|
|
|
2019-08-29 15:20:15 -04:00
|
|
|
Versions that are statically linking with the multi-threaded run-time library
|
|
|
|
can be built with -DMSVC_USE_STATIC_CRT=ON.
|
2002-12-07 09:18:50 -05:00
|
|
|
|
2019-08-28 19:36:55 -04:00
|
|
|
Static Linking: (through -DBUILD_shared=OFF)
|
2002-12-07 09:18:50 -05:00
|
|
|
|
2002-10-21 17:19:41 -04:00
|
|
|
The libraries should be named like this:
|
2002-12-07 09:18:50 -05:00
|
|
|
Multi-threaded: libexpat(w)MT.lib
|
|
|
|
Multi-threaded Dll: libexpat(w)MD.lib
|
2002-10-21 17:19:41 -04:00
|
|
|
The suffixes conform to the compiler switch settings
|
2019-08-28 19:36:55 -04:00
|
|
|
/MT and /MD for MS VC++.
|
2002-10-21 17:19:41 -04:00
|
|
|
|
|
|
|
An application linking to the static libraries must
|
|
|
|
have the global macro XML_STATIC defined.
|