为Visual Studio安装C/C ++的openCV 2.4 [英] Installing openCV 2.4 for C/C++ for Visual Studio

查看:81
本文介绍了为Visual Studio安装C/C ++的openCV 2.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整天都在尝试在Windows 7上为C/C ++安装Visual Studio 2010的OpenCV(版本2.4.1和2.4.2).

I have been trying all day to install OpenCV (versions 2.4.1 and 2.4.2) for Visual Studio 2010 on Windows 7 for C/C++.

我一直在关注本教程: http://docs .opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html

I have been following this tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html

我从此处跳过了安装第三方软件(python 2.7和zlib除外)的操作: http://gnuwin32 .sourceforge.net/packages/zlib.htm ).

I skipped installing 3rd party software (except python 2.7 and zlib from here: http://gnuwin32.sourceforge.net/packages/zlib.htm).

我运行cmake,然后从openCV构建目录打开openCV.sln,等待Visual Studio加载然后构建它. Visual Studio给出了200个错误,这些错误只是以下两次重复多次:

I run cmake, then open openCV.sln from openCV build directory, wait for visual studio to load and then build it. Visual studio gives 200 hundred errors which are just the following two repeated many times:

错误C1083:无法打开包含文件:'unistd.h':没有此类文件或目录

error C1083: Cannot open include file: 'unistd.h': No such file or directory

错误LNK1104:无法打开文件'.... \ lib \ Debug \ opencv_core241d.lib'

error LNK1104: cannot open file '....\lib\Debug\opencv_core241d.lib'

"OpenCV构建目录"/bin/Release不包含任何* .exe文件,而仅包含大量* .pdb文件,其中可以看到contours.pdb.教程说,我应该在那儿看到contours.exe.

"OpenCV build directory"/bin/Release does not contain any *.exe file, just a plenty of *.pdb files, among which I can see contours.pdb. The tutorial says that I should see contours.exe there.

因为没有* .exe文件,所以我知道在构建过程中遇到的两个错误很关键.对于能帮助我解决这些问题的任何想法,我将不胜感激.

As there are no *.exe files, I understand that two errors I get during build are critical. I would be grateful for any ideas that could help me solve them.

推荐答案

对构建步骤的以下解释应有助于您构建它:

The following interpretation of the build steps should help you build it:

  1. 安装cmake-所有平台都必需

  1. Install cmake - this is required for all platforms

cd进入解压缩的目录并创建一个名为release(或任何其他名称)的新目录

cd into the extracted directory and create a new directory called release(or any other name)

在此目录中,运行cmake ..

您应该在发行目录中找到一个 OpenCV.sln 文件.

You should find an OpenCV.sln file in the release directory.

使用Visual Stuido打开它并运行构建.

Open this with Visual Stuido and run a build.

继续使用Opencv

Go ahead and enjoy Opencv

这篇关于为Visual Studio安装C/C ++的openCV 2.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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