$ sudo apt install build-essential pkg-config cmake libx11-dev
- Install MSYS2 (https://www.msys2.org)
- Open
Start Menu > MSYS2 64bit > MSYS2 MSYS
and run the following commands:
$ pacman -Syu
$ ########## Close terminal window. ##########
$ pacman -Su
$ pacman -S base-devel
$ pacman -S mingw-w64-i686-toolchain
$ pacman -S mingw-w64-x86_64-toolchain
$ pacman -S mingw-w64-i686-cmake
$ pacman -S mingw-w64-x86_64-cmake
- To compile 32-bit version:
Start Menu > MSYS2 64bit > MSYS2 MinGW 32-bit
- To compile 64-bit version:
Start Menu > MSYS2 64bit > MSYS2 MinGW 64-bit
- Dependencies:
libwinpthread-1.dll
libgcc_s_dw2-1.dll
(for x86)libgcc_s_seh-1.dll
(for x64)ibstdc++-6.dll
$ cd dlib-x.y/build
$ cmake \
-G "MSYS Makefiles" \ # For Windows
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D USE_SSE2_INSTRUCTIONS=OFF \
-D USE_SSE4_INSTRUCTIONS=OFF \
-D USE_AVX_INSTRUCTIONS=ON \
-D DLIB_GIF_SUPPORT=OFF \
-D DLIB_JPEG_SUPPORT=ON \
-D DLIB_PNG_SUPPORT=ON \
-D DLIB_USE_BLAS=OFF \
-D DLIB_USE_LAPACK=OFF \
-D DLIB_USE_CUDA=OFF \
-D DLIB_NO_GUI_SUPPORT=OFF \
-D CMAKE_INSTALL_PREFIX=~/dlib \
..
$ make
$ make install
CMake:
FIND_PACKAGE(dlib REQUIRED)
TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${dlib_LIBRARIES})
- This file will define the following variables:
- dlib_LIBRARIES : The list of all imported targets for dlib modules.
- dlib_INCLUDE_DIRS : The dlib include directories.
- dlib_VERSION : The version of this dlib build.
- dlib_VERSION_MAJOR : Major version part of this dlib revision.
- dlib_VERSION_MINOR : Minor version part of this dlib revision.
PKG-CONFIG:
$ pkg-config --cflags --libs dlib-1