msys2 64 configuration with opencv and dlib

1. download and install

1.1 binary installation(install all the tool chain and lib with pacman):

source: http://www.msys2.org/

package: http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe

refercence: https://www.cnblogs.com/findumars/p/6360852.html

1.2 green file installaiton(the dlib is installed in the green package):

package(1): https://download.csdn.net/download/k_shmily/11127711

package(2): https://download.csdn.net/download/k_shmily/11127681

package(3): https://download.csdn.net/download/k_shmily/11127153

 

2. install the opencv343 for green file installation

2.1 download the opencv and related dependeny package

https://download.csdn.net/download/k_shmily/11159080

2.2 unzip all the pkg files into path "d:\msys64\var\cache\pacman\pkg"

2.3 run the install command

$ cd /c/msys64/var/cache/pacman/pkg/
...

$ pacman -U mingw-w64-x86_64-opencv-3.4.3-2-any.pkg.tar.xz
...
resolving dependencies...
looking for conflicting packages...

Packages (9) mingw-w64-x86_64-freeglut-3.0.0-4  mingw-w64-x86_64-ilmbase-2.3.0-1
             mingw-w64-x86_64-intel-tbb-1~2019_20181003-1  mingw-w64-x86_64-jasper-2.0.16-1
             mingw-w64-x86_64-libtiff-4.0.10-1  mingw-w64-x86_64-libwebp-1.0.2-1
             mingw-w64-x86_64-openexr-2.3.0-1  mingw-w64-x86_64-protobuf-3.7.1-1
             mingw-w64-x86_64-opencv-3.4.3-2

Total Installed Size:  171.90 MiB

:: Proceed with installation? [Y/n] y
(9/9) checking keys in keyring                               [###############################] 100%
(8/9) checking package integrity                             [###############################] 100%
(8/9) loading package files                                  [###############################] 100%
(9/9) checking for file conflicts                            [###############################] 100%
(9/9) checking available disk space                          [###############################] 100%
:: Processing package changes...
(1/9) installing mingw-w64-x86_64-intel-tbb                  [###############################] 100%
(2/9) installing mingw-w64-x86_64-freeglut                   [###############################] 100%
(3/9) installing mingw-w64-x86_64-jasper                     [###############################] 100%
(4/9) installing mingw-w64-x86_64-libtiff                    [###############################] 100%
(5/9) installing mingw-w64-x86_64-libwebp                    [###############################] 100%
(6/9) installing mingw-w64-x86_64-ilmbase                    [###############################] 100%
(7/9) installing mingw-w64-x86_64-openexr                    [###############################] 100%
(8/9) installing mingw-w64-x86_64-protobuf                   [###############################] 100%
(9/9) installing mingw-w64-x86_64-opencv                     [###############################] 100%
Optional dependencies for mingw-w64-x86_64-opencv
    mingw-w64-x86_64-eigen3
    mingw-w64-x86_64-ffmpeg: support to read and write video files
    mingw-w64-x86_64-python2-numpy: Python 2.x interface
    mingw-w64-x86_64-python3-numpy: Python 3.x interface
    mingw-w64-x86_64-hdf5: opencv_hdf module
    mingw-w64-x86_64-tesseract-ocr: opencv_text module

3 questions

3.1 win10环境中,MSYS64 中利用pacman安装dlib后,在使用find_package导入dlib库时,出现如下问题(找不到头文件路径、无法链接到相关的依赖库):

CMake Error in test/dlibTest/CMakeLists.txt:
  Imported target "dlib::dlib" includes non-existent path

    "/mingw64/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

    解决方法:将文件MSYS中的dlib.cmake中的Linux路径修改为window绝对路径

修改前:

  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/mingw64/include;/mingw64/include;/mingw64/include"
  INTERFACE_LINK_LIBRARIES "ws2_32;winmm;comctl32;gdi32;imm32;/mingw64/lib/libgif.dll.a;/mingw64/lib/libpng.dll.a;/mingw64/lib/libz.dll.a;/mingw64/lib/libjpeg.dll.a;-lcblas;-llapack;/mingw64/lib/libsqlite3.dll.a;/mingw64/lib/libfftw3.dll.a"

修改后:

  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;c:/msys64/mingw64/include"
  INTERFACE_LINK_LIBRARIES "ws2_32;winmm;comctl32;gdi32;imm32;c:/msys64/mingw64/lib/libgif.dll.a;c:/msys64/mingw64/lib/libpng.dll.a;c:/msys64/mingw64/lib/libz.dll.a;c:/msys64/mingw64/lib/libjpeg.dll.a;-lcblas;-llapack;c:/msys64/mingw64/lib/libsqlite3.dll.a;c:/msys64/mingw64/lib/libfftw3.dll.a"

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值