vs2015无法解析外部符号__imp__fprintf
使用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[] = { *stdin,*stdout,*stderr }; }
然后__imp__fprintf的解决方法就是在链接器输入lib里加上legacy_stdio_definitions.lib这个LIB
原文:http://www.letg.top/?p=34
vs2015无法解析外部符号__imp__fprintf的更多相关文章
- [解决方案]vs2015无法解析外部符号__imp__fprintf和__imp____iob_func
转自:http://www.cnblogs.com/ubosm/p/5444919.html 使用vs2015编译ffmpeg的一个小项时,出现了__imp__fprintf和__imp____iob ...
- c++预声明类引发的无法解析外部符号问题
在VisualStudio下开发C++程序常遇到链接问题就是:LNK2019 无法解析外部符号. 这个问题一般我们认为是没有将引用的代码链接到当前项目造成,也有例外,就是下面我要说的预声明类导致的. ...
- SDL 库 无法解析的外部符号 __imp__fprintf
VS2015 在链接器->命令行 里加入legacy_stdio_definitions.lib 另外一个常见错误关于stderr的用 extern "C" { FILE _ ...
- link2001错误无法解析外部符号metaObject
http://blog.sina.com.cn/s/blog_791f544a0100r01b.html 1>MainWindowBottomWidget.obj : error LNK ...
- QT中出现“无法解析的外部符号”错误
串口中我要把奇偶校验等enum数据对应写到一个ComboBox中去,所以需要在我的Settings类中加入一个函数用来转换. 这里,我首先在settings.h的class Settings中加上对该 ...
- Qt creator 编译错误:无法解析的外部符号(命令)
问题来自于:仅仅是在creator 中加入了一个新的DIalog类,并在main(),中实例化并show.就出现例如以下的错误: main.obj:-1: error: LNK2019: 无法解析的外 ...
- C++:FMC 错误
1.generated debug assertion -- File: docsingl.cpp Line: 215 MFC程序vs2008编译通过,运行时出错,无法打开,提示f:\dd\xxxx的 ...
- 音视频处理之FFmpeg+SDL视频播放器20180409
一.FFmpeg视频解码器 1.视频解码知识 1).纯净的视频解码流程 压缩编码数据->像素数据. 例如解码H.264,就是“H.264码流->YUV”. 2).一般的视频解码流程 视频码 ...
- VS 2013驱动开发 + Windbg + VM双机调试(亲测+详解)
------------VS 2013驱动开发 + Windbg + VM双机调试(亲测+详解)------------- WIN10已上线,随之而来的是VS2015:微软在 "WDK760 ...
随机推荐
- sshj ,ssh , springmvc pom.xml
记录下项目中的 pom文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/ ...
- PAT-乙级-1012. 数字分类 (20)
1012. 数字分类 (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 给定一系列正整数,请按要求对数字进 ...
- Unity3d + NGUI 的多分辨率适配(黑边)
原地址:http://www.2cto.com/kf/201310/250921.html 一.当下移动设备的主流分辨率(数据来自“腾讯分析移动设备屏幕分辨率分析报告”) 1.1 iOS设备的分辨率主 ...
- FZU-1921+线段树
简单的线段树. 记录MinVal 和 相应的ID即可 /* 线段树 */ #include<stdio.h> #include<string.h> #include<st ...
- java 读取文件中文乱码问题
很少写java io的代码,今天整了一个发现 本地调试好好的,放到jmeter里就打印乱码.一番折腾,终于搞定~直接上代码: List<Order> orderList = new Arr ...
- Subset leetcode java
题目: Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset mus ...
- Servlet课程0426(八)Servlet分页技术
Welcome.java //登录界面 package com.tsinghua; import javax.servlet.http.*; import java.io.*; import java ...
- Android:通过Intent访问一个网页
Intent(意图)主要是解决Android应用的各项组件之间的通讯. 小实例 package com.example.testopen; import android.app.Activity; i ...
- SQL Server常见问题总结
写在前面 在QQ群,微信群,论坛中经常帮助使用SQL Server数据库的朋友解决问题,但是有一些最常见最基本的问题,每天都有人问,回答多了也不想再解答了,索性把这些问题整理一下,再有人问到直接发链接 ...
- Java API ——StringBuffer类
1.StringBuffer类概述 1)我们如果对字符串进行拼接操作,每次拼接,都会构建一个新的String对象,既耗时,又浪费空间.而StringBuffer就可以解决这个问题 2)线程安全的可变字 ...