[英]Visual Studio not using additional include directories for KinectBridgeWithOpenCVBasics D2D C++ Sample, but does for other solutions.
I'm working on adding some openCV features to a couple projects that use the Kinect and openGL/freeGLUT. 我正在为使用Kinect和openGL / freeGLUT的几个项目添加一些openCV功能。 I have downloaded and installed OpenCV using the pre-built libraries and successfully run a simple sample. 我已经使用预构建的库下载并安装了OpenCV,并成功运行了一个简单的示例。 Now I want to work with the Kinect Bridge with OpenCV Basics sample from the Kinect for Windows Developer Toolkit to get a better idea of how to use OpenCV with the Kinect. 现在,我想使用Kinect for Windows Developer Toolkit中的Kinect Bridge with OpenCV Basics示例 ,以更好地了解如何在Kinect中使用OpenCV。 I downloaded the sample into my projects folder, opened the solution in visual studio and built it. 我将样本下载到我的项目文件夹中,在Visual Studio中打开解决方案并进行构建。 I got the following errors: 我收到以下错误:
Error 1 error C1083: Cannot open include file: 'opencv2/core/core.hpp': No such file or directory c:\\users\\justin\\documents\\visual studio 2010\\projects\\kinectbridgewithopencvbasics-d2d\\OpenCVHelper.h 17 错误1错误C1083:无法打开包含文件:'opencv2 / core / core.hpp':没有这样的文件或目录c:\\ users \\ justin \\ documents \\ visual studio 2010 \\ projects \\ kinectbridgewithopencvbasics-d2d \\ OpenCVHelper.h 17
and 和
Error 2 error C1083: Cannot open include file: 'opencv2/core/core.hpp': No such file or directory c:\\users\\justin\\documents\\visual studio 2010\\projects\\kinectbridgewithopencvbasics-d2d\\OpenCVFrameHelper.h 13 错误2错误C1083:无法打开包含文件:'opencv2 / core / core.hpp':无此类文件或目录c:\\ users \\ justin \\ documents \\ visual studio 2010 \\ projects \\ kinectbridgewithopencvbasics-d2d \\ OpenCVFrameHelper.h 13
Initially I thought these errors were due to forgetting to specify the additional include directories. 最初,我认为这些错误是由于忘记指定其他包含目录引起的。 I added the same property sheet that my other OpenCV projects use to this one, but the errors remained. 我将其他OpenCV项目使用的属性表添加到了该属性表中,但是仍然存在错误。 I tired copying the header files into the project folder: same thing. 我厌倦了将头文件复制到项目文件夹中:同样的事情。 It seems like the only thing that works is specifying the full absolute file paths in the #include statements. 似乎唯一可行的方法是在#include语句中指定完整的绝对文件路径。 I want to avoid doing this because visual studio wants me to change every #include in every file used in the project, including the openCV header files. 我想避免这样做,因为Visual Studio希望我更改项目中使用的每个文件(包括openCV标头文件)中的每个#include。 I also tried shortening the name of my project folder in case the file path was too long (though I'm pretty sure that's more of an issue for the header file paths), but again no change. 我还尝试缩短项目文件夹的名称,以防文件路径太长(尽管我很确定这对于头文件路径来说是一个更大的问题),但还是没有变化。
The include directories and #includes that I'm trying to use are the same as in my other projects. 我尝试使用的include目录和#includes与其他项目中的相同。 I'm using Visual Studio 2010 on Windows 7 x64 based system. 我在基于Windows 7 x64的系统上使用Visual Studio 2010。
Why would the additional include directory work for other projects, but not this one? 为什么附加的include目录可用于其他项目,但不适用于其他项目?
Usually when I see something like this it turns out to be a bad character in one of the prior include paths or other options that's messing everything up after it. 通常,当我看到类似这样的内容时,在先前的include路径或其他选项之一中发现它是一个坏字符,这会使它后面的所有内容混乱。 I would take a look at your the command line page in the project configuration and see if you can spot anything amiss. 我将在项目配置中查看您的命令行页面,看看是否可以发现任何不正确的地方。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.