vs2015无法解析外部符号__imp__fprintf 以及imp_iob_func错误
来源:互联网 发布:oracle删除数据恢复 编辑:程序博客网 时间:2024/04/27 19:54
使用vs2015编译ffmpeg的一个程序时,出现了__imp__fprintf和__imp____iob_func 的错误,以下是官方的回答:
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中和以前的vs版本的定义不同,所以报错。__imp____iob_func 解决方法:
使用{*stdin,*stdout,*stderr}数组自己定义__iob_func(),如下写法:
extern "C" { FILE __iob_func[3] = {*stdin,*stdout,*stderr }; }
对于__imp__fprintf的解决方法:
#pragma comment(lib, "legacy_stdio_definitions.lib")
- vs2015无法解析外部符号__imp__fprintf 以及imp_iob_func错误
- vs2015无法解析外部符号__imp__fprintf __imp____iob_func
- VS2015无法解析外部符号
- 编译sdl项目时出现无法解析的外部符号 __imp__fprintf解决办法
- vs2015 LNK2019无法解析的外部符号
- VS2015 无法解析的外部符号 __vsnwprintf_s
- vs2015::无法解析的外部符号 __snprintf
- VS2015 无法解析的外部符号 __vsnwprintf_s
- vs2015无法解析的外部符号 __imp___vsnprintf
- VS2015中MFC编译运行错误——无法解析的外部符号
- VS 无法解析的外部符号”[错误]
- 出现错误:无法解析的外部符号
- 无法解析外部符号
- error LNK2019: 无法解析的外部符号 错误解析
- 编译时出现错误:无法解析的外部符号
- “LNK2001: 无法解析的外部符号错误”的一种解决方案
- 无法解析的外部符号 Direct3DCreate9@4错误
- 【错误笔记】error LNK2019: 无法解析的外部符号 _cvHaarDetectObjects
- Android7.0上PopupWindow的showAsDropDown位置问题 参数无效
- 廖雪峰《python3 基础教程》读书笔记——第四章
- Scala解析Json格式
- do-while语句
- 页面中嵌入帆软报表,帆软报表服务器和项目不是一个,出现跨域的问题,解决方案
- vs2015无法解析外部符号__imp__fprintf 以及imp_iob_func错误
- 本地下载excel模板
- iptable端口转发
- 发布文件时,无法将文件**复制到**路径
- XML中DTD,XSD的区别与应用
- 畅通工程 ||HDU1232
- Lintcode合并排序数组 II
- Mongodb如何开启用户访问控制详解
- 文章标题 FWT (快速沃尔什变换) 模板