从VS2010迁移到VS 2017:获取错误__iob_func:找不到标识符 [英] Migrating from VS2010 to VS 2017: Getting error __iob_func: identifier not found

查看:759
本文介绍了从VS2010迁移到VS 2017:获取错误__iob_func:找不到标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将代码从VS 2010迁移到VS 2017&得到错误,例如"'__ iob_func':找不到标识符"。我尝试在网上搜索并观察到在链接时添加legacy_stdio_definitions.lib可以解决错误。但是,我在我的机器上找不到
(我使用VS 2017专业15.5.1版本。 

I am migrating code from VS 2010 to VS 2017 & getting errors like "'__iob_func': identifier not found". I tried searching on net and observed that adding legacy_stdio_definitions.lib while linking can resolve the error. But, I couldn't found it on my machine (I am using VS 2017 professional 15.5.1 version. 

从我到目前为止所读到的,我理解这个问题必须与CRT有关。

From what I have read so far, I understand that the issue must be related to CRT.

有人可以帮我解决这个问题吗?

Can someone please help me to resolve this issue?

推荐答案

感谢您在此处发帖。

>>从VS2010迁移到VS 2017:收到错误__iob_func :找不到标识符

在visual studio 2015中,stdin,stderr,stdout定义如下:

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])

在我看来,  legacy_stdio_definitions.lib意味着前您在vs2010中链接的std lib的vious版本。

In my opinion, the legacy_stdio_definitions.lib means the previous version of std lib which you linked in your vs2010.

或者你可以
升级
您的项目到2017年。 当您第一次打开在早期版本的Visual Studio中创建的Visual C ++项目时,系统可能会提示您更新项目。该消息询问您是否希望
升级到最新版本的Visual C ++编译器和库。

Or you could upgrade your project to vs 2017 by using the visual studio tool. When you first open a Visual C++ project that was created in an earlier version of Visual Studio, you might be prompted to update the project. The message asks whether you want to upgrade to the most recent version of the Visual C++ compiler and libraries.

希望这可以帮到你。

最好的问候,

Baron Bi


这篇关于从VS2010迁移到VS 2017:获取错误__iob_func:找不到标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆