Merge tag 'v5.2.4'
[xz/debian.git] / windows / INSTALL-MSVC.txt
blob7dd316852b30b404081df272acb2c551acd43b01
2 Building XZ Utils with Microsoft Visual Studio
3 ==============================================
5 Introduction
6 ------------
8     MSVC 2013 update 2 and later have enough C99 support to build
9     liblzma from XZ Utils 5.2.0 and later without modifications.
10     Older MSVC versions would require a large number of changes to
11     the XZ Utils code and thus the old MSVC versions aren't supported.
13     As of 2015-06-19, some work has been done to get xz.exe and other
14     command line tools built with MSVC, but it's not complete enough
15     to be included in XZ Utils.
18 Building
19 --------
21     The following files in this directory are for MSVC:
23         config.h              liblzma configuration #defines for MSVC.
24         liblzma.vcxproj       This builds static liblzma.
25         liblzma_dll.vcxproj   This builds liblzma.dll.
26         xz_win.sln            Solution using the above project files.
28     The projects have x86 and x86-64 platform configurations, as well
29     as a Debug, Release, and ReleaseMT configuration -- MT is the
30     compiler switch to link to the CRT statically, so it will not
31     have any other DLL dependencies.
33     Currently no test programs are built or run under MSVC.
35     MSVC gives a bunch of compiler warnings. Some warnings are specific
36     to 32-bit or 64-bit build and some appear for both builds. These
37     are known and shouldn't be a problem. Some of them will probably
38     be fixed in the future.
41 Notes
42 -----
44     liblzma API headers declare the functions with __declspec(dllimport)
45     by default. To avoid this when using static liblzma from your code,
46     #define LZMA_API_STATIC before #including <lzma.h>.