DLL can be created using MinGW+MSYS with the `make liblz4` command.
This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`.
-To compile a project the import library has to be added to linking options.
+The import library is only required with Visual C++.
+The header files `lz4.h`, `lz4hc.h`, `lz4frame.h` and the dynamic library
+`dll\liblz4.dll` are required to compile a project using gcc/MinGW.
+The dynamic library has to be added to linking options.
It means that if a project that uses LZ4 consists of a single `test-dll.c`
file it should be compiled with "liblz4.lib". For example:
```
- gcc $(CFLAGS) test-dll.c -o test-dll liblz4.lib
+ gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.dll
```
+The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
#### Miscellaneous
#### The package contents
- `dll\liblz4.dll` : The DLL of LZ4 library
-- `dll\liblz4.lib` : The import library of LZ4 library
-- `include\` : Header files required with LZ4 library
+- `dll\liblz4.lib` : The import library of LZ4 library for Visual C++
- `fullbench\` : The example of usage of LZ4 library
+- `include\` : Header files required with LZ4 library
- `static\liblz4_static.lib` : The static LZ4 library
#### Using LZ4 DLL with gcc/MinGW
-The header files from `include\` and the import library `dll\liblz4.lib`
+The header files from `include\` and the dynamic library `dll\liblz4.dll`
are required to compile a project using gcc/MinGW.
-The import library has to be added to linking options.
+The dynamic library has to be added to linking options.
It means that if a project that uses LZ4 consists of a single `test-dll.c`
-file it should be compiled with "liblz4.lib". For example:
+file it should be compiled with "liblz4.dll". For example:
```
- gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.lib
+ gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.dll
```
The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
$(CC) $(FLAGS) $^ -o $@$(EXT) static/liblz4_static.lib
fullbench-dll: fullbench/fullbench.c fullbench/xxhash.c
- $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 dll/liblz4.lib
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 dll/liblz4.dll
clean:
@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
$(MAKE) -C $(LZ4DIR) liblz4
- $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.lib
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.dll
fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
#### Projects available within lz4.sln
The Visual Studio solution file `lz4.sln` contains many projects that will be compiled to the
-`visual\VS2010\bin\$(Platform)_$(Configuration)\lz4.exe` directory. For example `lz4` set to `x64` and
+`visual\VS2010\bin\$(Platform)_$(Configuration)` directory. For example `lz4` set to `x64` and
`Release` will be compiled to `visual\VS2010\bin\x64_Release\lz4.exe`. The solution file contains the
following projects:
project using Visual C++.
1. The path to header files should be added to `Additional Include Directories` that can
- be found in project properties `C/C++` then `General`.
+ be found in Project Properties of Visual Studio IDE in the `C/C++` Property Pages on the `General` page.
2. The import library has to be added to `Additional Dependencies` that can
- be found in project properties `Linker` then `Input`.
+ be found in Project Properties in the `Linker` Property Pages on the `Input` page.
If one will provide only the name `liblz4.lib` without a full path to the library
- the directory has to be added to `Linker\General\Additional Library Directories`.
+ then the directory has to be added to `Linker\General\Additional Library Directories`.
The compiled executable will require LZ4 DLL which is available at
`visual\VS2010\bin\$(Platform)_$(Configuration)\liblz4.dll`.