Visual Studio 15 __imp___iob,__imp___pctype,__imp___mb_cur_max [英] Visual Studio 15 __imp___iob, __imp___pctype, __imp___mb_cur_max

查看:4587
本文介绍了Visual Studio 15 __imp___iob,__imp___pctype,__imp___mb_cur_max的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio中使用用mingw编译的库。但是,我得到以下链接器错误:


错误LNK2001:未解析的外部符号__imp ___ iob



错误LNK2019:在函数

中引用的未解析的外部符号__imp___pctype $ p
$ b

错误LNK2019:函数中引用的未解析的外部符号__imp____mb_cur_max

错误LNK2001:无法解析的外部符号_fprintf




我能够通过链接到legacy_stdio_definitions.lib修复_fprintf错误post:未解析的外部符号__imp__fprintf和__imp____iob_func,SDL2 < a>。



但是,我不知道如何修复其他三个未解决的外部。如何解决这个问题?



编辑:



这里是一个更新。我把libmsvcrt.a从mingw lib文件夹移动到Visual Studio,我添加到链接器设置。现在看起来工作正常。

解决方案

这些库是针对旧版本的CRT编译的。您得到的未解析符号是编译库中存在的CRT的内部符号。您必须针对VS2015 CRT(通用CRT)重新编译库。但我不知道MinGW是否支持这个。



如果你不能这样做,你必须继续使用VS2013编译器。 (您可以使用VS2015 IDE,通过在工程选项中将工具集设置为vs2013,但是您仍然只能使用2013年编译器支持的C ++功能。)


I am trying to use a library compiled with mingw in visual studio. However, I get the following linker errors:

error LNK2001: unresolved external symbol __imp___iob

error LNK2019: unresolved external symbol __imp___pctype referenced in function

error LNK2019: unresolved external symbol __imp____mb_cur_max referenced in function

error LNK2001: unresolved external symbol _fprintf

I was able to fix the _fprintf error by linking against legacy_stdio_definitions.lib as per this post : unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2.

However, I have no idea how to fix the other three unresolved externals. How can I fix this? The libraries work perfectly under Visual Studio 2013.

Edit:

Okay here is an update. I moved libmsvcrt.a from the mingw lib folder into Visual Studio, and I added that to the linker settings. Now it seems to work correctly.

解决方案

The libraries were compiled against an old version of the CRT. The unresolved symbols you get are internal symbols of the CRT that are present in the compiled library. You have to recompile the library against the VS2015 CRT (the Universal CRT). But I'm not sure if MinGW supports this.

If you can't do that, you have to continue to use the VS2013 compiler. (You can use the VS2015 IDE, by setting the toolset to vs2013 in the project options. But you'll still be limited to the C++ features the 2013 compiler supports.)

这篇关于Visual Studio 15 __imp___iob,__imp___pctype,__imp___mb_cur_max的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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