git subrepo pull (merge) --force deps/libchdr
[pcsx_rearmed.git] / deps / libchdr / deps / zstd-1.5.5 / lib / dll / example / README.md
CommitLineData
648db22b 1# ZSTD Windows binary package
2
3## The package contents
4
5- `zstd.exe` : Command Line Utility, supporting gzip-like arguments
6- `dll\libzstd.dll` : The ZSTD dynamic library (DLL)
7- `dll\libzstd.lib` : The import library of the ZSTD dynamic library (DLL) for Visual C++
8- `example\` : The example of usage of the ZSTD library
9- `include\` : Header files required by the ZSTD library
10- `static\libzstd_static.lib` : The static ZSTD library (LIB)
11
12## Usage of Command Line Interface
13
14Command Line Interface (CLI) supports gzip-like arguments.
15By default CLI takes an input file and compresses it to an output file:
16
17 Usage: zstd [arg] [input] [output]
18
19The full list of commands for CLI can be obtained with `-h` or `-H`. The ratio can
20be improved with commands from `-3` to `-16` but higher levels also have slower
21compression. CLI includes in-memory compression benchmark module with compression
22levels starting from `-b` and ending with `-e` with iteration time of `-i` seconds.
23CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined
24into `-b1e18i1`.
25
26## The example of usage of static and dynamic ZSTD libraries with gcc/MinGW
27
28Use `cd example` and `make` to build `fullbench-dll` and `fullbench-lib`.
29`fullbench-dll` uses a dynamic ZSTD library from the `dll` directory.
30`fullbench-lib` uses a static ZSTD library from the `lib` directory.
31
32## Using ZSTD DLL with gcc/MinGW
33
34The header files from `include\` and the dynamic library `dll\libzstd.dll`
35are required to compile a project using gcc/MinGW.
36The dynamic library has to be added to linking options.
37It means that if a project that uses ZSTD consists of a single `test-dll.c`
38file it should be linked with `dll\libzstd.dll`. For example:
39
40 gcc $(CFLAGS) -Iinclude\ test-dll.c -o test-dll dll\libzstd.dll
41
42The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`.
43
44## The example of usage of static and dynamic ZSTD libraries with Visual C++
45
46Open `example\fullbench-dll.sln` to compile `fullbench-dll` that uses a
47dynamic ZSTD library from the `dll` directory. The solution works with Visual C++
482010 or newer. When one will open the solution with Visual C++ newer than 2010
49then the solution will be upgraded to the current version.
50
51## Using ZSTD DLL with Visual C++
52
53The header files from `include\` and the import library `dll\libzstd.lib`
54are required to compile a project using Visual C++.
55
561. The path to header files should be added to `Additional Include Directories` that can
57 be found in project properties `C/C++` then `General`.
582. The import library has to be added to `Additional Dependencies` that can
59 be found in project properties `Linker` then `Input`.
60 If one will provide only the name `libzstd.lib` without a full path to the library
61 the directory has to be added to `Linker\General\Additional Library Directories`.
62
63The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`.