转自:http://www.cnblogs.com/ubosm/p/5444919.html

使用vs2015编译ffmpeg的一个小项时,出现了__imp__fprintf和__imp____iob_func 的错误,google了一下,有的人 建议下载SDL源码重新编译一下,当然这个方案非常不科学。所以又继续搜,终于有所发现。

这是老外的原话:

In visual studio 2015, stdin, stderr, stdout are defined as follow :

#define stdin  (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))

But previously, they were defined as:

#define stdin  (&__iob_func()[0])
#define stdout (&__iob_func()[1])
#define stderr (&__iob_func()[2])

So now __iob_func is not defined anymore which leads to a link error when using a .lib file compiled with previous versions of visual studio.

To solve the issue, you can try defining __iob_func() yourself which should return an array containing {*stdin,*stdout,*stderr}.

Regarding the other link errors about stdio functions (in my case it was sprintf()), you can add legacy_stdio_definitions.lib to your linker options.

答题意思就是stdin, stderr, stdout 这几个函数vs2015和以前的定义得不一样,所以报错。

解决方法呢,就是使用{*stdin,*stdout,*stderr}数组自己定义__iob_func()

其实就是下边这样。

extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }

然后__imp__fprintf的解决方法就是在链接器输入lib里加上legacy_stdio_definitions.lib这个LIB

[解决方案]vs2015无法解析外部符号__imp__fprintf和__imp____iob_func的更多相关文章

  1. vs2015无法解析外部符号__imp__fprintf

    使用vs2015编译ffmpeg的一个小项时,出现了__imp__fprintf和__imp____iob_func 的错误,google了一下,有的人 建议下载SDL源码重新编译一下,当然这个方案非 ...

  2. c++预声明类引发的无法解析外部符号问题

    在VisualStudio下开发C++程序常遇到链接问题就是:LNK2019 无法解析外部符号. 这个问题一般我们认为是没有将引用的代码链接到当前项目造成,也有例外,就是下面我要说的预声明类导致的. ...

  3. SDL 库 无法解析的外部符号 __imp__fprintf

    VS2015 在链接器->命令行 里加入legacy_stdio_definitions.lib 另外一个常见错误关于stderr的用 extern "C" { FILE _ ...

  4. link2001错误无法解析外部符号metaObject

    http://blog.sina.com.cn/s/blog_791f544a0100r01b.html     1>MainWindowBottomWidget.obj : error LNK ...

  5. 百度DMA+小度App的蓝牙语音解决方案技术难点解析

    前记   你平时在商场看到的语音助手,看起来非常的简单,其实,这个小小语音助手的背后,是一个非常的复杂的技术支撑.从前端到后端的技术依次是:前端语音降噪技术,高效的音频编解码技术,蓝牙双模技术,DMA ...

  6. QT中出现“无法解析的外部符号”错误

    串口中我要把奇偶校验等enum数据对应写到一个ComboBox中去,所以需要在我的Settings类中加入一个函数用来转换. 这里,我首先在settings.h的class Settings中加上对该 ...

  7. Qt creator 编译错误:无法解析的外部符号(命令)

    问题来自于:仅仅是在creator 中加入了一个新的DIalog类,并在main(),中实例化并show.就出现例如以下的错误: main.obj:-1: error: LNK2019: 无法解析的外 ...

  8. XML之SAX解析模型

    DOM解析会把整个XML文件全部映射成Document里的树形结构,当遇到比较大的文件时,它的内存占用很大,查找很慢 SAX就是针对这种情况出现的解决方案,SAX解析器会从XML文件的起始位置起进行解 ...

  9. DNS预解析dns-prefetch提升页面载入速度优化前端性能

    当浏览器请求一个URL的时候,通过firebug我们可以发现大概有以下几个过程:阻挡.域名解析.建立连接.发送请求.等待响应.接收数据.后面四个跟用户的网络情况和你的服务器处理速度有关,本文重点说说前 ...

随机推荐

  1. ajax请求的封装

    前端的工作,免不了要用到交互,请求后端的数据,可能大多人一直选择用jq封装好的方法直接使用,要知道封装这个事我们自己也可以的,今天给大家介绍一种封装方法,而且连跨域问题都不在话下,有了这个函数,是不是 ...

  2. Linux一些零碎

    1.设置时间和市区 1.tzselect 2.sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

  3. Linux服务器搬迁记(一)

    更换服务器必过之坑(一):文件转移 Linux服务器一般通过ssh进行远程操作,为了避免各种权限问题导致转移不成功,我一般直接使用root账户.这次却是行不通了.ssh进行文件传输,默认禁止用root ...

  4. sprintf数据库查询的作用

    $sql = sprintf("UPDATE file SET mimetype=null,title=null,size=null,protected=null WHERE id=%d&q ...

  5. Jmeter学习(三十三)调试工具Debug Sampler

    一.Debug Sampler介绍: 使用Jmeter开发脚本时,难免需要调试,这时可以使用Jmeter的Debug Sampler,它有三个选项:JMeter properties,JMeter v ...

  6. [转]ORACLE函数大全

    SQL中的单记录函数 1.ASCII返回与指定的字符对应的十进制数;SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ' ...

  7. shell中{}的妙用

    shell中${}的妙用   1. 截断功能 ${file#*/}:       拿掉第一条/及其左边的字符串:dir1/dir2/dir3/my.file.txt ${file##*/}:    拿 ...

  8. mogodb监控脚本

    mongodb_server.py #! /bin/env python #-*- coding:utf8 -*- import sys import os from bson.timestamp i ...

  9. HTML5 video标签播放视频下载原理

    HTML5 video https://github.com/remy/html5demos/blob/master/demos/video.html <video preload=" ...

  10. UDP server & client

    Server: import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; ...