使用OpenCV的本地构建/自构建的OpenCV项目的正确包含目录在哪里? [英] Where are the correct include directories for OpenCV projects using a local build / selfbuild of OpenCV?

查看:391
本文介绍了使用OpenCV的本地构建/自构建的OpenCV项目的正确包含目录在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试一个令人沮丧的问题,因为我无法在OpenCV中加载视频文件. 一个建议是放弃

I'm trying to debug a frustrating problem whereby I cannot load video files in OpenCV. One suggestion is to abandon the OpenCV pre-built libraries and instead build OpenCV on the same machine as the failing project.

这就是我现在想要做的.

That is what I am now trying to do.

有关如何在Microsoft Visual Studio中使用OpenCV构建应用程序的OpenCV快速入门,一个重要步骤是通过打开项目的属性页,导航到Configuration Properties -> C/C++ -> General -> Additional Include Directories,将其他include目录添加到项目属性表中.建议使用预构建的发行版添加目录C:\OpenCV2.4.6\build\include,实际上在该目录内是子目录opencvopencv2.我的项目(与大多数OpenCV项目一样)需要的文件之一是highgui.hpp行中的文件

In the OpenCV Quick Start about how to build applications with OpenCV inside the Microsoft Visual Studio one important step is to add the additional include directories to the project property sheet by opening the project's property pages, navigating to Configuration Properties -> C/C++ -> General -> Additional Include Directories. Using the pre-built distribution I am advised to add the directory C:\OpenCV2.4.6\build\include and indeed inside that directory are sub-directories opencv and opencv2. One of the files my project (like most OpenCV projects) will need is highgui.hpp from the line

#include "opencv2/highgui/highgui.hpp"

在预构建的OpenCV发行版中,highgui.hppC:\OpenCV2.4.6\build\include\opencv2\highgui结尾,由于附加的包含目录,因此可以在编译时正确提取.

In the pre-built OpenCV distribution highgui.hpp ends up in C:\OpenCV2.4.6\build\include\opencv2\highgui and is thus correctly picked up at compile time because of the additional include directory.

已在计算机上使用CMake生成并使用Visual Studio 2012构建了最新版本的OpenCV(尽管可能未成功)我找不到highgui.hpp.它不在C:\Users\timregan\Documents\GitHub\opencv\build\include中(实际上那里没有子目录opencvopencv2).它在C:\ opencv-2.4 \ modules \ highgui \ include \ opencv2 \ highgui中.

Having generated with CMake and built with Visual Studio 2012 the latest version of OpenCV on my machine (though perhaps unsuccessfully) I cannot find highgui.hpp. It is not in C:\Users\timregan\Documents\GitHub\opencv\build\include (in fact there are no sub-directories opencv nor opencv2 in there). It is in C:\opencv-2.4\modules\highgui\include\opencv2\highgui.

为了将其正确放置在机器上,我省略了什么步骤,标志等?为什么在生成并构建OpenCV之后,opencvopencv2子目录完全从C:\Users\timregan\Documents\GitHub\opencv\build\include中丢失了?

What step, flag, etc. did I omit in order to generate place it correctly on my machine? Why are the opencv and opencv2 sub-directories missing completely from C:\Users\timregan\Documents\GitHub\opencv\build\include after I have generated and built OpenCV?

(注:我在Windows 8计算机上使用CMake 2.8.12和Visual Studio 2012.)

(N.B. I'm using CMake 2.8.12 and Visual Studio 2012 on a Windows 8 machine.)

推荐答案

打开Visual Studio解决方案,然后右键单击安装项目,然后进行构建.包含文件应显示在C:\Users\timregan\Documents\GitHub\opencv\selfbuild\install

open the visual studio solution and right click on install project and then build. the include files should appear in C:\Users\timregan\Documents\GitHub\opencv\selfbuild\install

这篇关于使用OpenCV的本地构建/自构建的OpenCV项目的正确包含目录在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆