Dlib 错误:错误 C1083:无法打开包含文件:"type_safe_union/type_safe_union_kernel.h"
Dlib Error: error C1083: Cannot open include file:'type_safe_union/type_safe_union_kernel.h'
我想使用Visual Studio 2013中的Dlib (c++库)图像处理包。
我创建了一个空项目,并在解决方案资源管理器的源文件中添加了"dlib-18.16dliball Source .cpp"。然后,我将dlib-18.16的路径添加到我的vc++目录中的包含目录中,我还将dlib-18.16dlib的路径添加到我的Visual Studio C/c++ General中的附加包含目录中。
我可以运行文件matrix_ex.cpp,这是Dlib的一个例子,但我不能运行文件face_detection_ex.cpp,因为错误"无法打开包括文件:'type_safe_union/type_safe_union_kernel.h'",这实际上是由#include <dlib/image_processing/frontal_face_detector.h>
如何解决这个问题?为什么程序找到一些头文件,但它不能找到其他的,而他们都位于同一文件夹?
你需要将dlib文件夹本身添加到vc++目录中的Include目录中,而不是添加它上面的文件夹。
通过扩展,这意味着您的include指令需要是#include <image_processing/frontal_face_detector.h>
。
dlib-18.16.tar.bz2
并将其解压缩到c:projects
。这将创建一个名为c:projectsdlib-18.16
的文件夹。在vc++目录中添加c:projectsdlib-18.16
到Include目录
然而,这是不正确的,你应该删除该目录,而不是添加c:projectsdlib-18.16dlib
,因为这是项目的包含目录。
这将导致#include <type_safe_union/type_safe_union_kernel.h>
加载C:projectsdlib-18.16dlibtype_safe_uniontype_safe_union_kernel.h
以及文件之间类似的内部链接。
- C++Union/Struct位域的实现和可移植性
- 使用 [] 运算符时"binding reference of type discards qualifiers"
- 在 QVector<std::unique_ptr 上使用 std::find<Type>>
- 在类型和包装器之间reinterpret_cast是否安全<Type>?
- 使用 cmake 的 Linux 终端上的"Conversion to non-scalar type is requested"错误
- 控制到达非空函数clang(-Wreturn-type)的末尾
- std::unordered_map 类型对象声明期间出现"field has incomplete type"错误
- 如何通过多类"Union variable" (sfml) 使用轮询事件
- 错误:"Left of getValue must have class/struct/union"
- 将系数存储在头文件的数组中("does not name a type"错误)
- 尝试打开 ifstream 时出现"Incomplete type"错误
- 将成员函数作为构造函数参数调用时出错 "Variable is not a type name"
- 在"结构提升::enable_if<提升::is_pod<T>,无效>"中没有名为"type"的类型
- "Missing type specifier - int assumed"无法通过向主函数添加"return 0"来解决
- OpenCV CV_16F type
- C++ "错误:在'类 std::result_of< ... >"中没有名为'type'的类型"
- C++Union,两个活跃成员,仅简历资格不同
- 获取"Use of undefined type"和"Must have class/struct/union"错误
- 不断收到错误"member reference base type 'string [1000]' is not a structure or union"不知道如何解决?
- 实现观察者模式的问题:"Member reference base type ________ is not a structure or union"