C++ 如何构建 opencv 与 2015 x86
C++ How can I build opencv for vs 2015 x86
我想在我的VS2015 C++项目中使用opencv,我需要它完全用于x86平台,而不是x64。我按照互联网上任何地方的建议使用 CMake。更重要的是,我尝试配置多个版本的opencv - 2.4.9;3.0.0;3.1.0在每次通过 CMake 进行配置和生成时,我都会收到很多错误。这是配置后来自CMake gui的日志:
CMake Deprecation Warning at CMakeLists.txt:69 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:74 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
The CXX compiler identification is MSVC 19.0.23506.0
The C compiler identification is MSVC 19.0.23506.0
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Performing Test HAVE_CXX_FSIGNED_CHAR
Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
Performing Test HAVE_C_FSIGNED_CHAR
Performing Test HAVE_C_FSIGNED_CHAR - Failed
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of unsigned short
Check size of unsigned short - done
Using unsigned short
Check if the system is big endian - little endian
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Check size of off64_t
Check size of off64_t - failed
Looking for assert.h
Looking for assert.h - found
Looking for fcntl.h
Looking for fcntl.h - found
Looking for io.h
Looking for io.h - found
Looking for jbg_newlen
Looking for jbg_newlen - not found
Looking for mmap
Looking for mmap - not found
Looking for search.h
Looking for search.h - found
Looking for string.h
Looking for string.h - found
Looking for unistd.h
Looking for unistd.h - not found
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
d41d8cd98f00b204e9800998ecf8427e (expected:
b59f865d1ba16e8c84124e19d78eec57)
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
ICV: Downloading ippicv_windows_20141027.zip...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
file DOWNLOAD HASH mismatch
for file: [D:/opencv-3.0/opencv/sources/3rdparty/ippicv/downloads/windows-b59f865d1ba16e8c84124e19d78eec57/ippicv_windows_20141027.zip]
expected hash: [b59f865d1ba16e8c84124e19d78eec57]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [6;"Couldn't resolve host name"]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
ICV: Failed to download ICV package: ippicv_windows_20141027.zip.
Status=6;"Couldn't resolve host name"
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
Configuring incomplete, errors occurred!
See also "D:/opencv-build/CMakeFiles/CMakeOutput.log".
See also "D:/opencv-build/CMakeFiles/CMakeError.log".
此日志是在生成后:
CMake Deprecation Warning at CMakeLists.txt:69 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:74 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
d41d8cd98f00b204e9800998ecf8427e (expected:
b59f865d1ba16e8c84124e19d78eec57)
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
ICV: Downloading ippicv_windows_20141027.zip...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
file DOWNLOAD HASH mismatch
for file: [D:/opencv-3.0/opencv/sources/3rdparty/ippicv/downloads/windows-b59f865d1ba16e8c84124e19d78eec57/ippicv_windows_20141027.zip]
expected hash: [b59f865d1ba16e8c84124e19d78eec57]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [6;"Couldn't resolve host name"]
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
ICV: Failed to download ICV package: ippicv_windows_20141027.zip.
Status=6;"Couldn't resolve host name"
Call Stack (most recent call first):
3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
cmake/OpenCVFindIPP.cmake:235 (include)
cmake/OpenCVFindLibsPerf.cmake:12 (include)
CMakeLists.txt:526 (include)
Configuring incomplete, errors occurred!
See also "D:/opencv-build/CMakeFiles/CMakeOutput.log".
See also "D:/opencv-build/CMakeFiles/CMakeError.log".
CMakeOutput.log 和 CMakeError.log 都不可读。它们充满了不可读的字符。
我怎样才能得到这个 vc14 x86 版本的 opencv!?我被卡住了。
在 OpenCVConfig.cmake 中,
if(MSVC)
message("CMAKE_CL_64 is ${CMAKE_CL_64}")
if(CMAKE_CL_64)
set(OpenCV_ARCH x64)
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
# see Modules/CmakeGenericSystem.cmake
set(OpenCV_ARCH ARM)
else()
set(OpenCV_ARCH x86)
endif()
相关文章:
- Visual Studio 2015:Extern "C" 和 "export" 关键字
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 如何使用OpenCV将RBG图像转换为HSV,并将H、S和V值保存为C++中的3个独立图像
- OpenCV EqualizeHist()从彩色图像创建黑白图像
- 将OpenCV C++重写为EmguCV C#-如何使用指针
- OpenCV C++.快速计算混淆矩阵
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- 哪些库可以通过Opencv调整曝光率
- 'cv':构建时不存在具有此名称的命名空间(VS 2015,OpenCV 3.2)
- 如何在 OPENCV 3.x C++ Visual Studio 2015 中声明 BruteForceMatcher
- Visual Studio 2015 OpenCV Assertion 在 cv::imshow windows 中失败 (size.width>0 && size.height>0.cp
- OpenCV Webcam 源未显示在 PictureBox visual studio 2015 中
- C++ 如何构建 opencv 与 2015 x86
- 错误 C1083 无法在 VS 2015 中打开包含文件:"opencv2\opencv.hpp"
- OpenCV和Visual Studio 2015:为什么包含静态库不起作用
- Visual Studio 2015 and opencv 3.0
- OpenCV与Visual Studio 2015企业版
- 使用 Cmake 为 Visual Studio 2015 构建 OpenCV 3.0.0 的 DLL