在 Windows 中编译 OpenCV SVN trunk - highgui/libVideoInput 中出现错误
我知道有几个与此相关的问题,但没有一个问题告诉我如何应对所得到的错误。
使用本指南我已经能够使用本指南和 cmake 编译当前的 OpenCV 版本 (2.2)。所以这个版本工作得很好,我可以在 Qt 中使用它编写代码。因此我需要启用WITH_QT并且需要自己构建。
但不幸的是我发现 2.2 版本并不支持所有类型的相机(因为我想从 720p 网络摄像头获取相机流)。我读到这个问题在最新的 svn trunk 版本中已修复。
所以我检查了最新的 svn trunk 并再次运行 Cmake,创建一个新文件夹,选择源文件,使用 g++.exe 和 qcc.exe 的链接进行 MinGW 编译,配置并启用“WITH_QT”并生成必要的 Makefile。
然后我以管理员身份启动 Windows Powershell 并尝试使用“mingw32-make”进行编译...但在 56% 时它突然崩溃:
[ 56%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_sunras.obj
[ 56%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_tiff.obj
Linking CXX shared library ..\..\bin\libopencv_highgui220d.dll
Creating library file: ..\..\lib\libopencv_highgui220d.dll.a
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
ee): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
104): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2a6): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2d4): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2fe): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
314): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4b6): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4e4): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1b41): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1b5a): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1bb4): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1c03): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1c88): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1ca7): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2265): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
228d): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2318): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2337): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
28f5): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
291d): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
38a0): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
38df): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
406b): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
40a3): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4211): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
42ec): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6cf8): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6d17): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6e1e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6e3e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7002): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
70b4): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
70cd): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7111): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
742e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7501): undefined reference to `_Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [bin/libopencv_highgui220d.dll] Error 1
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
mingw32-make: *** [all] Error 2
所以编译 libVideoInput 时似乎出了问题... 有人熟悉这个错误吗?我该如何修复它?我之前需要安装什么特殊的东西吗?
如果有人能帮助我那就太好了!谢谢!
I know there are several questions about this but none has shown me what I can do against the error I get.
Using this guide I already was able to compile the current OpenCV Release (2.2) using this guide and cmake. So the release works fine and I can write code using it in Qt. Therefore I need WITH_QT enabled and need to build myself.
But unfortunately I found out that the 2.2 release doesn't support all types of cameras (since I would like to get the camera stream from a 720p webcam). I've read that this is fixed in the latest svn trunk version.
So I checked the newest svn trunk out and ran Cmake again, created a new folder, selected the source files, MinGW compile with links to the g++.exe and qcc.exe, configured and enabled "WITH_QT" and generated the necessary Makefiles.
I then started a Windows Powershell as Admin and tried to compile with "mingw32-make"... but at 56% it suddenly crashes with this:
[ 56%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_sunras.obj
[ 56%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_tiff.obj
Linking CXX shared library ..\..\bin\libopencv_highgui220d.dll
Creating library file: ..\..\lib\libopencv_highgui220d.dll.a
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
ee): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
104): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2a6): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2d4): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2fe): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
314): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4b6): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4e4): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1b41): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1b5a): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1bb4): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1c03): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1c88): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
1ca7): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2265): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
228d): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2318): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
2337): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
28f5): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
291d): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
38a0): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
38df): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
406b): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
40a3): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
4211): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
42ec): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6cf8): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6d17): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6e1e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
6e3e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7002): undefined reference to `_Unwind_SjLj_Resume'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
70b4): undefined reference to `__gxx_personality_sj0'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
70cd): undefined reference to `_Unwind_SjLj_Register'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7111): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
742e): undefined reference to `_Unwind_SjLj_Unregister'
C:\workspace\opencv\OpenCV_SVN\modules\highgui\..\..\3rdparty\lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0x
7501): undefined reference to `_Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [bin/libopencv_highgui220d.dll] Error 1
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
mingw32-make: *** [all] Error 2
So it seems to have something going wrong when compiling the libVideoInput...
is anybody familiar with this error? How can I fix it? Do I need to install anything special before?
Would be great if anybody could help me! Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理论上,通过QT安装OpenCV,你不需要highgui库。所以在安装OpenCV的过程中,你应该从Cmake gui中取消选择highgui。 Youtube/Web 上有一些教程展示了如何在没有 highgui lib 的情况下使用 OpenCV 和 QT。祝你好运
Theoretically, by installing OpenCV with QT, you do not need highgui library. So during the installation of OpenCV, you should deselect highgui from Cmake gui. There are some tutorials on Youtube/Web that are showed how to use OpenCV and QT without highgui lib. Good luck with that