使用contrib-modules安装Opencv 3.0.0

时间:2014-12-11 14:37:26

标签: opencv visual-studio-2012 build

我在64位计算机上安装了Windows 8.1 PC。我已经从源代码安装了OpenCV 3.0.0而没有使用opencv_contrib。以下是berak-的回答 Nonfree module is missing in OpenCV 3.0,我下载了contrib并尝试再次从源代码构建opencv,但这次打开了OPENCV_EXTRA_MODULES选项。

在这个构建过程中,我从VS编译器得到了奇怪的错误。他们来自档案

  

\模块\ line_descriptor \ SRC \ binary_descriptor.cpp

以下关于行号的错误如下:

  1. 错误C2143:语法错误:缺少&#39 ;;'之前' =' E:\ opencv \ opencv-master \ opencv_contrib-master \ modules \ line_descriptor \ src \ binary_descriptor.cpp line 833

  2. 错误C2059:语法错误:'>' 836行

  3. 错误C2143:语法错误:缺少&#39 ;;'之前' {' E:\ opencv \ opencv-master \ opencv_contrib-master \ modules \ line_descriptor \ src \ binary_descriptor.cpp line 837

  4. 错误LNK1104:无法打开文件' .... \ lib \ Debug \ opencv_line_descriptor300d.lib' E:\ opencv \ opencv-master \ build \ modules \ line_descriptor \ LINK opencv_test_line_descriptor

  5. 错误7错误MSB3073:命令" setlocal " C:\ Program Files(x86)\ CMake \ bin \ cmake.exe" -DBUILD_TYPE = Debug -P cmake_install.cmake if%errorlevel%neq 0 goto:cmEnd :cmEnd endlocal& call:cmErrorLevel%errorlevel%&转到:cmDone :cmErrorLevel 退出/ b%1 :cmDone if%errorlevel%neq 0 goto:VCEnd :VCEnd"退出代码1. C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V120 \ Microsoft.CppCommon.targets 132 5 INSTALL

1 个答案:

答案 0 :(得分:1)

几周前,我遇到了同样的问题。我这样解决了:

编辑\ modules \ line_descriptor \ src \ binary_descriptor.cpp

并将此行放在define:

之后
#undef near

再次运行cmake(使用-DBUILD_opencv_line_descriptor = ON)

我禁用的是:_cvv和_world