设置OpenCV和.lib文件 [英] Setting Up OpenCV and .lib files

查看:345
本文介绍了设置OpenCV和.lib文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图设置OpenCV过去几天没有结果。我使用Windows 7和VS C ++ 2008 express版。我已经下载并安装了OpenCV 2.1和一些例子工作。我下载了CMake并运行它生成VS项目文件,并构建所有的,但有几个错误,并且不能得到任何远远超过那个。

I have been trying to set up OpenCV for the past few days with no results. I am using Windows 7 and VS C++ 2008 express edition. I have downloaded and installed OpenCV 2.1 and some of the examples work. I downloaded CMake and ran it to generate the VS project files and built all of them but there with several errors, and couldn't get any farther than that.

当我运行CMake时,我配置它使用VS 9编译器,然后它提出了一个红色项目列表,如BUILD_EXAMPLES,BUILD_LATEX_DOCS等。除了BUILD_NEW_PYTHON_SUPPORT,BUILD_TESTS,ENABLE_OPENMP和OPENCV_BUILD_3RDPARTY_LIBS之外,所有这些都已取消选中。我配置和生成没有任何改变,然后它生成VS文件,如ALL_BUILD.vcproj。我在调试模式下构建了OpenCV VS解决方案,它有15个失败(可能这是问题的一部分,还是因为我没有python和这样的东西?)

When I ran CMake I configured it to use the VS 9 compiler, and then it brought up a list of items in red such as BUILD_EXAMPLES, BUILD_LATEX_DOCS, ect. All of them were unchecked except BUILD_NEW_PYTHON_SUPPORT, BUILD_TESTS, ENABLE_OPENMP, and OPENCV_BUILD_3RDPARTY_LIBS. I configured and generate without changing anything and then it generated the VS files such as ALL_BUILD.vcproj. I built the OpenCV VS solution in debug mode and it had 15 failures (maybe this is part of the problem or is it because I don't have python and stuff like that?)

现在有一个lib文件夹后建立,但内部只有这个VC ++最小重建依赖文件和程序调试数据库文件,两者都称为cvhaartraining。我相信它应该已经创建了.lib文件我需要而不是这。此外,bin文件夹现在有一个名为Debug的文件夹,其名称类似于cv200d和cvaux200d。

Now there was a lib folder created after building but inside there was just this VC++ Minimum Rebuild Dependency file and Program Debug Database file, both called cvhaartraining. I believe it should have created the .lib files I need instead of this. Also, the bin folder now has a folder called Debug with the same types of files with names like cv200d and cvaux200d.

相信我需要这些.lib文件。

Believe I need those .lib files to move forward.

我也非常感激,如果有人可以指示我一个可靠的教程来设置VS for OpenCV,因为我一直在阅读很多教程,他们都说不同的东西如一些说配置窗口的环境变量和其他说文件位于文件夹如OpenCV / cv,我没有。我已经超过了明确的头脑的想法,如果任何人可以提供一些方向或一个简单的文件列表,我需要链接,那么我会感激。

I would also greatly appreciate if someone could direct me to a reliable tutorial to set up VS for OpenCV because I have been reading a lot of tutorials and they all say different things such as some say to configure Window's environment variables and other say files are located in folders such as OpenCV/cv which I don't have. I have gotten past the point of clear headed thinking so if anyone could offer some direction or a simple list of the files I need to link then I would be thankful.

一个侧问题:为什么当链接OpenCV库时,你必须把它们放在引号中?

Also a side question: why when linking the OpenCV libs do you have to put them in quotes?

推荐答案

开始,你应该可以抢先预编译的OpenCV库。它是来自此页面的OpenCV-2.1.0-win32-vs2008.exe。

If you're just getting started, you should probably grab the prebuilt libraries for OpenCV instead. It's OpenCV-2.1.0-win32-vs2008.exe from this page.

一旦你有了,真的没有设置。只需链接到您已创建的任何VS项目中的(已经构建的)lib文件,并确保OpenCV包含目录在项目包含路径。

Once you have that, there is really no setup. Just link to the (already built) lib files in any VS project you create, and make sure the OpenCV include directory is in the projects include path.

这篇关于设置OpenCV和.lib文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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