构建32位库opencv [英] Building 32bit libraries opencv
问题描述
我最近下载并使用 cmake
在我的64位Windows机器上构建了opencv。所有二进制文件都包含在 install
文件夹中,它只包含如下所示的文件夹:
我不知道如何配置cmake来生成x86的二进制文件。我问这个,因为我使用 Qt Creator 32位与MinGW ,我在链接和编译代码时遇到问题。什么是正确的方法来做建立?我使用 mingw
编译器套件。
注意:下载的软件包包含预构建的二进制 x86
,但是没有针对MinGW,但只针对Visual Studio。
从 cmake-gui 的mingw步骤/ qt-5-3-1-64-bit-mingw-windows /rel =nofollow>指南。我们也可以很容易地在命令提示符下用 cmake
和 -m32
选项。但是使用 cmake-gui
会让你更好地了解opencv配置的可用选项,如果你想自定义opencv的构建方式, OpenCL等)。
- 启动cmake-gui。
-
设置
源路径
到下载的opencv目录和构建路径
-
单击
配置
按钮并将generator指定为mingw makefiles as
- 选择编译器(这里我们选择32位)作为图像,然后单击
完成
按钮。
-
将会列出一个选项页面。编辑
CMAKE_INSTALL_PREFIX
为
更改安装位置。更改其他选项只有当你是
熟悉他们。然后再次点击配置
,然后点击生成生成make文件。 - 在构建路径)
mingw32-make
(将mingw32-make
code>如果需要) - 完成后,输入
mingw32-make install
I recently downloaded and built opencv in my 64-bit Windows machine using cmake
. All the binaries are included in the install
folder and it contains only the folders as shown below:
I don't know how to config cmake to produce binaries for x86. I'm asking this, because I'm using Qt Creator 32bit with MinGW and I'm getting problems while linking and compiling the code. What's the proper way to do the build? I'm using mingw
compiler suite.
Note: The downloaded package contains the pre-built binaries for x86
but there are none for MinGW, but only for Visual Studio.
Steps for mingw from with cmake-gui
from this guide. We could also do this easily on command prompt with cmake
and -m32
option. But using cmake-gui
will give you more idea about the options available for opencv configuration and bring you in better position if you want to customize opencv build tomorrow ( like enabling java wrapper or OpenCL etc ).
- Start cmake-gui.
Set
source path
to downloaded opencv directory andbuild path
to your choice as in imageClick
Configure
button and specify generator as mingw makefiles as in image- Choose compilers ( here we choose 32 bit ) as in image and click
Finish
button.
An options page will be listed. Edit
CMAKE_INSTALL_PREFIX
for changing install location. Change other options only if you are familiar with them. Then clickConfigure
again and then click 'Generate` to generate make files.In command prompt( at build path ) type
mingw32-make
( addmingw32-make
folder toPATH
if required )- On completion, type
mingw32-make install
这篇关于构建32位库opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!