如何安装opencv与tbb启用使用mingw [英] How to install opencv with tbb enabled using mingw
问题描述
如何在启用TBB的情况下安装Opencv?
我尝试了以下操作:
1)下载TBB包。
2)使用以下命令生成
mingw32-make compiler = gcc arch = ia32 runtime = mingw默认
3)我将环境变量路径设置为d:\tbb\build\ windows_ia32_gcc_mingw_release
3)现在使用cmake,我启用了WITH_TBB并编译了opencv。
[22%]建立目标pch_Generate_opencv_core
链接CXX共享库.. \..\ bin \libopencv_core245.dll
c:/ mingw / bin /../ lib / gcc / mingw32 / 4.6.2 /../../../../ mingw32 / bin / ld.exe:can not fin
d -ltbb
collect2:ld返回1退出状态
make [2]:*** [bin / libopencv_core245.dll]错误1
make [1]:** * [modules / core / CMakeFiles / opencv_core.dir / all]错误2
make:*** [all]错误2
我缺少任何东西...
请咨询..
有相同的问题,以下是为了消除tbb链接错误:
(假设你已经建立了tbb,因为你已经在你的问题中解释) p>
-
从CMake配置一次OpenCV
-
第二次配置OpenCV
-
现在应该出现一些变量:
TBB_INCLUDE_DIRS
。对我来说,分别设置以下值:
tbb41_20130314oss / include
-
出现2个新变量:
TBB_STDDEF_PATH
和TBB_LIB_DIR
。他们被赋予一些明显合理的价值。对我来说,TBB_STDDEF_PATH
是正确的,但TBB_LIB_DIR
不是!所以我将其更正为:
tbb41_20130314oss / build / windows_ia32_gcc_mingw4.8.1_release
,我留下
TBB_STDDEF_PATH
,因为它是:
tbb41_20130314ossoss / include / tbb / tbb_stddef.h
-
设定第三 / li>
-
最后,点击Generate并准备建立
mingw32-make -j7
-
一旦您开始使用opencv库,请使用您的路径中的tbb DLL。
WITH_TBB
,请小心不启用 BUILD_TBB
:自动下载和构建OpenCV我尽管许多努力。如果您以前启用了 BUILD_TBB
,我的建议是从头开始重新启动,清除cmake缓存。 How to install Opencv with TBB enabled?
I tried the following:
1) Downloaded the TBB package.
2) Build using the below command
mingw32-make compiler=gcc arch=ia32 runtime=mingw default
3) I set the Environmental variable path as "d:\tbb\build\windows_ia32_gcc_mingw_release
3) Now using cmake, I enabled "WITH_TBB" and compiled the opencv.
its throwing the below error.
[ 22%] Built target pch_Generate_opencv_core
Linking CXX shared library ..\..\bin\libopencv_core245.dll
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot fin
d -ltbb
collect2: ld returned 1 exit status
make[2]: *** [bin/libopencv_core245.dll] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
Am I missing anything... Please advice..
I had the same problem, the following worked out for removing the tbb linking error:
(Assuming you have already built tbb, as you are already explaining in your question)
From CMake, configure one time OpenCV
Enable
WITH_TBB
, be careful not enablingBUILD_TBB
: the automatic downloading and building of OpenCV failed miserably for me despite many efforts. If you had previously enabledBUILD_TBB
, my suggestion is to restart from the beginnning, clearing cmake cache.Configure a second time OpenCV
Now some variables should appear:
TBB_INCLUDE_DIRS
. For me I set the following values (respectively):tbb41_20130314oss/include
2 new variables appears:
TBB_STDDEF_PATH
andTBB_LIB_DIR
. They are assigned some apparently reasonable values. For me,TBB_STDDEF_PATH
was correct, butTBB_LIB_DIR
was not! So I corrected it to be:tbb41_20130314oss/build/windows_ia32_gcc_mingw4.8.1_release
and I left
TBB_STDDEF_PATH
as it was:tbb41_20130314oss/include/tbb/tbb_stddef.h
Configure a third time
Finally, click Generate, and you are ready to build
mingw32-make -j7
Once you start using the opencv library, make sue the tbb DLLs are in your path
这篇关于如何安装opencv与tbb启用使用mingw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!