简体   繁体   English

在Qt项目中包含dlib

[英]Including dlib in Qt project

I am trying to add dlib library to my Qt5 project. 我正在尝试将dlib库添加到我的Qt5项目中。 I've build dlib with gcc 4.9.3 using CMake without NO_GUI_SUPPORT (ie with GUI) and without ISO_CPP_ONLY . 我已经在不使用NO_GUI_SUPPORT (即使用GUI)和没有ISO_CPP_ONLY情况下使用CMake使用gcc 4.9.3构建了ISO_CPP_ONLY I've compiled it into shared library with CMAKE_INSTALL_PREFIX = my_qt_project_dir/dlib , installed and included it into my project: 我已经使用CMAKE_INSTALL_PREFIX = my_qt_project_dir/dlib将其编译到共享库中,已安装并将其包含在我的项目中:

# DLIB
INCLUDEPATH += $$PWD/dlib/include/
LIBS += -L$$PWD/dlib/lib/
LIBS += -ldlib

I am including this headers in code: 我在代码中包含此标头:

#include <dlib/image_processing.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_io.h>
#include <dlib/dir_nav.h>
#include <dlib/opencv.h>

but during compilation get this errors 但是在编译过程中出现此错误

some of them: 他们中的几个:

/dlib/include/dlib/image_processing/../matrix/matrix_la.h:64:45: error: macro "sign" passed 2 arguments, but takes just 1
/dlib/include/dlib/image_processing/../matrix/matrix_math_functions.h:83:27: error: expected unqualified-id before 'const'
/dlib/include/dlib/image_processing/../matrix/matrix_la.h:1034:9: error: 'matrix' has not been declared

I am using CMake 3.3.1, QtCreator 3.4.2, Qt 5.4.2, gcc 4.9.3 running on gentoo 4.0.9. 我正在使用在gentoo 4.0.9上运行的CMake 3.3.1,QtCreator 3.4.2,Qt 5.4.2,gcc 4.9.3。

How to deal with this? 该如何处理?

Someone #defined the word "sign" and it's stomping on the code. 有人#defined定义了“ sign”一词,它在代码上code脚。 Figure out what code creates the sign #define and #include it after other headers. 找出由什么代码创建符号#define并将其包含在其他标头之后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM