zoukankan      html  css  js  c++  java
  • 20100714 23:46 OpenCV 2.1 两个小问题

    转载自http://hi.baidu.com/dbzhang800/item/1dd5621596b52f25f7625c41

    1. Mingw 相关的 videoInput 的问题

    Mingw4.4 编译OpenCV2.1 时,编译失败:

    OpenCV2.1.0/src/highgui/http://www.cnblogs.com/3rdparty/lib/libvideoInput.a(videoInput.o):videoInput.cpp:(.text+0xee):
    undefined reference to`__gxx_personality_sj0'

    根源:问题出在 libvideoInput 这个静态库上,该库是由 Mingw SjLj 编译的,而 Mingw DW2 下不能用。

    这样一来,只有自己来编译这个东西的,或者干脆不用它算了。

    不过,还好,急用的话,网络上有人已经编译过了,

    http://code.google.com/p/pyopencv/downloads/detail?name=libvideoInput.a&can=2&q=

    直接拷贝到 ${opencv_root}/3rdparty/lib 下替换掉原来的libvideoInput.a 就行了。

    2. avcodec 相关

    Compiler did not align stack variables. Libavcodec has been miscompiled
    and may be very slow or crash. This is not a bug in libavcodec,
    but in the compiler. You may try recompiling using gcc >= 4.2.
    Do not report crashes to FFmpeg developers.

    mingw 和 vs2008 编译后程序运行后,都有这个问题,但是Mingw可以正常运行,而VS2008的直接程序异常。

    而在OpenCV2.0 中没遇到这个问题,对比一下二者相关的库和头文件

    • 3rdparty\lib\libavcodec.a
    • 3rdparty\include\ffmpeg_\avcodec.h

    发现二者版本有所不同,

    OpenCV2.0

    #define LIBAVCODEC_VERSION_MAJOR 52
    #define LIBAVCODEC_VERSION_MINOR 20
    #define LIBAVCODEC_VERSION_MICRO 0

    OpenCV2.1

    #define LIBAVCODEC_VERSION_MAJOR 52
    #define LIBAVCODEC_VERSION_MINOR 20
    #define LIBAVCODEC_VERSION_MICRO 1

    估计仍和前一个问题一样,是采用的Mingw编译器版本太低造成的,不想编译这个库,直接用2.0的库和头文件覆盖2.1的库和头文件,重新编译OpenCV2.1 问题消失。

    即使不使用,程序退出时都报内存访问错误。

  • 相关阅读:
    WPF的本质:数据和行为
    WPF 布局
    wpf中的样式与模板
    WPF命令
    WPF数据转换
    WPF 深入研究 之 Control 控件
    WPF布局控件
    WPF TextBox 验证输入
    Razor引擎学习:RenderBody,RenderPage和RenderSection
    WPF控件模版
  • 原文地址:https://www.cnblogs.com/yingying0907/p/2601145.html
Copyright © 2011-2022 走看看