我在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
以下关于行号的错误如下:
错误C2143:语法错误:缺少&#39 ;;'之前' =' E:\ opencv \ opencv-master \ opencv_contrib-master \ modules \ line_descriptor \ src \ binary_descriptor.cpp line 833
错误C2059:语法错误:'>' 836行
错误C2143:语法错误:缺少&#39 ;;'之前' {' E:\ opencv \ opencv-master \ opencv_contrib-master \ modules \ line_descriptor \ src \ binary_descriptor.cpp line 837
错误LNK1104:无法打开文件' .... \ lib \ Debug \ opencv_line_descriptor300d.lib' E:\ opencv \ opencv-master \ build \ modules \ line_descriptor \ LINK opencv_test_line_descriptor
错误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
答案 0 :(得分:1)
编辑\ modules \ line_descriptor \ src \ binary_descriptor.cpp
并将此行放在define:
之后#undef near
再次运行cmake(使用-DBUILD_opencv_line_descriptor = ON)
我禁用的是:_cvv和_world