简体   繁体   English

使用dlib库进行编译

[英]Compiling with dlib libraries

I'm trying to compile one of the examples in the dlib /examples folder. 我正在尝试在dlib / examples文件夹中编译示例之一。 If I keep everything as is (keep the example in the examples folder) then it works and compiler just fine. 如果我将所有内容保持不变(将示例保留在examples文件夹中),则它可以正常工作并且编译器就可以了。 However, if I move the example out of the folder (and adjust the path in the compile command accordingly), I get a "no such file or directory" 但是,如果将示例移出文件夹(并相应地调整compile命令中的路径),则会收到“无此类文件或目录”

Obviously, I'm trying to do this because in a real scenario, I can't simply put all my code into the examples folder of the dlib library. 显然,我正在尝试执行此操作,因为在实际情况下,我不能简单地将所有代码放入dlib库的examples文件夹中。

concretely: the dlib libraries have been unpacked into my "Downloads" folder. 具体来说:dlib库已解压缩到我的“下载”文件夹中。 the example I'm trying to compile is bayes_net_ex.cpp the command I'm using to compile the example is 我要编译的示例是bayes_net_ex.cpp我用来编译示例的命令是

g++ -O3 -I.. /home/user/Downloads/dlib/all/source.cpp -lpthread -lX11 bayes_net_ex.cpp 

The error message is 错误消息是

bayes_net_ex.cpp:40:30: fatal error: dlib/bayes_utils.h: No such file or directory
#include <dlib/bayes_utils.h>
                          ^

compilation terminated. 编译终止。

You have to tell your compiler where to look for #include files. 您必须告诉编译器在哪里查找#include文件。 So add -I/home/user/Downloads/ 因此,添加-I / home / user / Downloads /

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

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