无法使用Qt(mingw32 x64)编译dlib

时间:2019-06-27 11:25:49

标签: c++ qt opencv mingw-w64 dlib

我使用此代码工作了2天,我只是不知道如何通过此错误。 我用mingw32 x64编译dlib,一切正常,但是当我将库包含在qt的.pro文件中时,我会遇到很多错误。

这是我的专业文件:

QT       += core gui sql

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent

QT += multimedia multimediawidgets network

CONFIG += c++11

TARGET = examinator
TEMPLATE = app

DEFINES += DLIB_JPEG_SUPPORT
DEFINES += DLIB_PNG_SUPPORT

INCLUDEPATH += F:\examinator\opencv-4.1.0\build\install\include
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_core410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_highgui410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_imgcodecs410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_imgproc410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_features2d410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_calib3d410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_video410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_videoio410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_flann410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_gapi410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_ml410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_objdetect410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_photo410.dll.a"
    LIBS += "F:\examinator\opencv-4.1.0\build\install\x64\mingw\lib\libopencv_stitching410.dll.a"

#INCLUDEPATH += "F:\examinator\dlib-19.10\build\install\include"
#    LIBS += "F:\examinator\dlib-19.10\build\install\lib\libdlib.a"
INCLUDEPATH += "F:\examinator\dlib-19.10\build\install\include"
LIBS +=-L"F:\examinator\dlib-19.10\build"
LIBS +=-ldlib

    LIBS += "C:\Program Files (x86)\libjpeg\lib\liblibjpeg.a"
    LIBS += "C:\Program Files (x86)\libpng\lib\libpng.a"
    LIBS += "C:\Program Files (x86)\libpng\lib\libpng16.a"

那是错误。

enter image description here

2 个答案:

答案 0 :(得分:0)

尝试将-L放在双引号中,并使用斜杠(而不是反斜杠)作为目录分隔符:

LIBS +="-LF:/examinator/dlib-19.10/build"

答案 1 :(得分:0)

经过几次尝试,我发现了这些错误的来源,其中大多数是在我用CMake编译dlib时出现的,我也包含libpng,libjpg和zlib,但是在我的.pro文件中我没有正确包含它们。在正确包含它们之后,我便能够构建我的应用程序。

import GHC.Exts (IsList(..))

instance IsList XYZs where
  type Item XYZs = XYZ
  fromList = XYZs
  toList = getXYZs