Visual Studio 2015中的其他包含目录不起作用 [英] Additional include directory in Visual studio 2015 doesn't work
问题描述
我正在尝试为自己的项目重用可用的源代码,可以在这里找到它:
https://github.com/TadasBaltrusaitis/OpenFace
我尝试编译原始代码的FeatureExtract项目,一切都很好.然后,我创建了一个新的空项目,并添加了以下#include:
I was trying to re-use an available source code for my own project, it can be found here:
https://github.com/TadasBaltrusaitis/OpenFace
I tried compiling project FeatureExtraction of the original code, everything was fine. Then I created a new empty project and added the following #include:
#include "LandmarkCoreIncludes.h"
#include <Face_utils.h>
#include <FaceAnalyser.h>
#include <GazeEstimation.h>
这些与提供的源代码中的Project FeatureExtraction完全相同.我已经将C/C ++常规标签中的其他包含目录更改为:
These are exactly the same as in project FeatureExtraction in the provided source code. I've already changed the additional include directories in C/C++ general tab into:
$(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.
推荐答案
使用#include "header.h"
而不是带有菱形(< and >)
的钻石,而该钻石会出现在另一个目录中.
Use #include "header.h"
instead of the one with diamonds (< and >)
which looks in another directory.
然后,检查头文件是否确实在这些目录中.如果是这样,则应检查$(SolutionDir)
(在$(SolutionDir)
之后我不使用'\'
,但它也可以解决).
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).
尝试找到并删除.suo
文件,然后重新启动VS
Try to locate and delete the .suo
file and restart VS
这篇关于Visual Studio 2015中的其他包含目录不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!