Windows: Update notes about static linking with MSVC.

This commit is contained in:
Lasse Collin 2012-04-29 11:51:25 +03:00
parent aac1b31ea4
commit 29fa0566d5
1 changed files with 9 additions and 4 deletions

View File

@ -90,10 +90,15 @@ Microsoft Visual C++
lib /def:liblzma.def /out:liblzma.lib /machine:x64
Linking against static liblzma should work too. Rename liblzma.a
to e.g. liblzma_static.lib and tell MSVC to link against it. You
also need to tell lzma.h to not use __declspec(dllimport) by defining
the macro LZMA_API_STATIC. You can do it either in the C/C++ code
Linking against static liblzma might work too, but usually you
should use liblzma.dll if possible. (Or, if having a decompressor
is enough, consider using XZ Embedded or LZMA SDK which can be
compiled with MSVC.)
To try linking against static liblzma, rename liblzma.a to e.g.
liblzma_static.lib and tell MSVC to link against it. You also need
to tell lzma.h to not use __declspec(dllimport) by defining the
macro LZMA_API_STATIC. You can do it either in the C/C++ code
#define LZMA_API_STATIC
#include <lzma.h>