如何在MacOS High Sierra上将X11链接到Qt项目

时间:2018-08-13 11:36:29

标签: c++ macos qt x11 dlib

我尝试使用dlib编译Qt项目

#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/dnn.h>
#include <dlib/gui_widgets.h>
#include <dlib/clustering.h>
#include <dlib/string.h>
#include <dlib/image_io.h>
#include <iostream>

using namespace cv;
using namespace dlib;
using namespace std;

int main(int argc, char *argv[])
{
    frontal_face_detector detector = get_frontal_face_detector();
    matrix <rgb_pixel> image;
    load_image(image, "/Users/ivanlebedev/Desktop/Projects/ManSearch/cars/2.jpg");
    image_window win(image);
}

但是我有这个错误:

/usr/local/Cellar/dlib/19.15/include/dlib/gui_core/gui_core_kernel_2.h:12: ошибка: "Also make sure you have libx11-dev installed on your system"
#error "Also make sure you have libx11-dev installed on your system"
 ^

我如何使我的程序正常工作?

1 个答案:

答案 0 :(得分:0)

您不需要也不需要x11。您需要在没有x11支持的情况下编译dlib,然后它将正常工作。