简体   繁体   English

Visual Studio 2015中的其他包含目录不起作用

[英]Additional include directory in Visual studio 2015 doesn't work

I was trying to re-use an available source code for my own project, it can be found here: 我试图为我自己的项目重用可用的源代码,可以在这里找到:
https://github.com/TadasBaltrusaitis/OpenFace https://github.com/TadasBaltrusaitis/OpenFace
I tried compiling project FeatureExtraction of the original code, everything was fine. 我尝试编译原始代码的项目FeatureExtraction,一切都很好。 Then I created a new empty project and added the following #include: 然后我创建了一个新的空项目并添加了以下#include:

#include "LandmarkCoreIncludes.h"

#include <Face_utils.h>
#include <FaceAnalyser.h>
#include <GazeEstimation.h>  

These are exactly the same as in project FeatureExtraction in the provided source code. 这些与提供的源代码中的项目FeatureExtraction完全相同。 I've already changed the additional include directories in C/C++ general tab into: 我已经将C / C ++常规选项卡中的其他包含目录更改为:

$(SolutionDir)\lib\local\FaceAnalyser\include  
$(SolutionDir)\lib\local\LandmarkDetector\include  

However, it still gave me "cannot open source file error". 但是,它仍然给了我“无法打开源文件错误”。
Update: If I put the absolute path of the header file directly to the code it is OK, however if I put the absolute path to the Additional Include Directories, the error remained. 更新:如果我将头文件的绝对路径直接放到代码中就可以了,但是如果我将绝对路径放到其他包含目录中,则错误仍然存​​在。

Use #include "header.h" instead of the one with diamonds (< and >) which looks in another directory. 使用#include "header.h"而不是带有菱形(< and >)那个,它在另一个目录中查找。

After that, check if the header files really are in these directories. 之后,检查头文件是否确实在这些目录中。 If they are, you should check the $(SolutionDir) ( I don't use a '\\' after the $(SolutionDir) but it may work out as well). 如果是,你应该检查$(SolutionDir) (我在$(SolutionDir)之后不使用'\\' ,但它也可以$(SolutionDir) )。

Try to locate and delete the .suo file and restart VS 尝试找到并删除.suo文件并重新启动VS

Looks like I had same "bug" as mentioned in this post here: 看起来我在这篇文章中提到了同样的“bug”:
Visual Studio does not honor include directories Visual Studio不支持包含目录
After having changed the Additional Include Directories for all platforms instead, the code was compiled without any errors. 在更改了所有平台的附加包含目录之后,编译的代码没有任何错误。

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

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