zoukankan      html  css  js  c++  java
  • 无法定位 xxxx 与动态链接库 avcodec-xx.dll上

    http://blog.csdn.net/liuruihan/article/details/26716271

    http://blog.csdn.net/bing87496988/article/details/25061659

    http://blog.csdn.net/mythma/article/details/26558619


    最近用vs2008在做一个基于ffmpeg的解码模块,debug下调试没有发现问题, 但是在release下运行时提示如下错误,百思不得其解,查了一下午也没找到什么问题。期间也换过不同的ffmpeg库,保证lib和dll是同一版本,但是也没有解决问题。

     

    最终找到了问题的解决办法: release 项目属性中-----》连接器----》优化   选项中选择:保留未引用数据 



    /////////////////////////////////////////////////////////////////////////////////////////////////////////////



    win7 下开发视频服务器,用到ffmpeg,debug版本运行正常,切换到release时,出现"0x00905a4d 处未处理的异常: 0xC0000005: 读取位置 0x00905a4d 时发生访问冲突",原以为是jrtplib得问题,鼓捣半天才发现是ffmpeg. 用一个很小的测试程序验证,在av_register_all处就崩溃.鸟!
    难道是用mingw生成ffmpeg时有调试信息,应用程序用release编译冲突?
    ffmpeg版本老旧,有这个bug?
    我编译的选项不对?
    测试排除了上面3个疑问. 那就只有debug和release版本的区别了. 将release的优化选项逐个的剔除测试,找到了问题所在:
    连接器->优化->引用 

    在release版本下面使用"保留未引用数据(/OPT:NOREF)"选项才可以正常运行.

    google "ffmpeg OPT:NOREF" 发现有人已经发现并解决了这个问题.

    ////////////////////////////////////////////////////////////////////////////////////////////

    编译FFmpeg是一件痛苦的事情,一般都直接使用Zeranoe FFmpeg Builds

    如果使用这个版本,需要注意ffmpeg的帮助里的一段话:

    1. To create import libraries that work with the /OPT:REF option (which is enabled by default in Release mode), follow these steps:  
    2.   
    3. Open the Visual Studio Command Prompt.  
    4. Alternatively, in a normal command line prompt, call ‘vcvars32.bat’ which sets up the environment variables for the Visual C++ tools (the standard location for this file is something like ‘C:Program Files (x86_Microsoft Visual Studio 10.0VCinvcvars32.bat’).  
    5.   
    6. Enter the ‘bin’ directory where the created LIB and DLL files are stored.  
    7. Generate new import libraries with lib.exe:  
    8.       
    9. lib /machine:i386 /def:..libfoo-version.def  /out:foo.lib  
    10. Replace foo-version and foo with the respective library names. 
    即根据dll重新生成lib文件。

    否则Relesae下就会出问题。


    这是VS2010的一个bug,据说VS2012后已经修复。




  • 相关阅读:
    Core的学习三:容器的使用实例
    Core的学习二:【四步完成】.Net Core中Log4net的使用,配置,【框架.NET5】
    C#7 的一些新语法
    C#6 的一些新语法
    Core的学习一:Core部署在IIS下
    C# 特性【Attribute】【什么是特性?以及特性的一些修饰】
    C#反射
    泛型 -Generic 【why,原理,与普通方法,object的性能对比如何?泛型类、泛型方法、泛型接口、泛型委托,泛型约束,协变 逆变,泛型缓存】
    springboot通过切面编程实现系统请求操作日志记录
    Linux 【安装配置VM虚拟机】
  • 原文地址:https://www.cnblogs.com/silyvin/p/9106868.html
Copyright © 2011-2022 走看看