使用MSVC 2015进行编译时即使使用/MD加载许多DLL也会导致ERROR_DLL_INIT_FAILED [英] Compiling with MSVC 2015 causes ERROR_DLL_INIT_FAILED when loading many DLLs even with /MD

查看:96
本文介绍了使用MSVC 2015进行编译时即使使用/MD加载许多DLL也会导致ERROR_DLL_INIT_FAILED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建潜在的数百个DLL,在极端情况下,主机应用程序实际上将加载所有DLL.它们很小,并且都连接到实现实际功能的一个主要DLL.没有其他方法可以解决,这是一个插件世界.

I need to create potentially hundreds of DLLs and in extreme cases the host app will actually load all of them. These are tiny and all connect to one major DLL that implements the actual features. There's no other way around it, it's a world of plugins.

现在,当编译并与MSVC 2013链接时,一切都很好,我实际上能够同时加载所有它们.但是我尝试切换到MSVC 2015,当说60个插件时,LoadLibrary返回ERROR_DLL_INIT_FAILED.

Now when compiled and linked with MSVC 2013, it was all fine and I was actually able to load all of them at the same time. But I tried to switch to MSVC 2015 and when reaching say 60 plugins, LoadLibrary returns ERROR_DLL_INIT_FAILED.

我用Google搜索了它,看起来TLS表中可能充满了C ++库的内容,也许我想过在MSVC 2015中添加了一些内容,所以我尝试使用/MD进行编译,没有运气.仍然可以(尽管接口DLL很小).

I googled it and it looked like the TLS table could be filled with C++ libs stuff, maybe something was added to MSVC 2015 I thought, so I tried compiling with /MD, no luck. Still does that (though the interface DLLs are much smaller).

有什么想法吗?

推荐答案

您好,Vojtech meluzin,

Hi Vojtech meluzin,

感谢您的信息.

>>现在,当编译并与MSVC 2013链接时,一切都很好,我实际上能够同时加载所有它们.但是我尝试切换到MSVC 2015,并在遇到问题时说了一下. 60个插件,LoadLibrary返回ERROR_DLL_INIT_FAILED.

您的项目是在VS2013中创建的吗?

Did your project created in VS2013?

排除VS2015的原因.请创建一个新的项目,例如C ++控制台应用程序.然后使用MSVC2015进行编译.检查是否有相同的错误.

To exclude the cause of your VS2015. Please create a new project like C++ console application. Then using MSVC2015 to compile it. Check whether it has the same error.

由于到达第60个插件时返回了错误.它在VS2013中运行良好.我想MSVC 2015中发生了一些更改,导致它与第60个插件不兼容.

Since the error was returned when reaching the 60th plugins. And it works well in VS2013. I suppose something was changed in MSVC 2015 which cause it's not compatible with the 60th plugin.

此外,由于我们的论坛正在讨论VS通用问题,例如如何设置/配置Visual Studio和Visual Studio工具.

In addition, since our forum is discussing about VS general question like how to set/configure Visual Studio and Visual Studio tools.

如果我们确定问题不在您的IDE中.并针对编译错误.我建议您可以提供详细的代码或将其发布到C ++论坛以获得更好的支持.

And if we are sure the problem is not in your IDE. And for the compiling error. I suggest you could provide the detailed code or post it to the C++ forum for better support.

感谢您的理解.


最好的问候,


Best Regards,

肖湖

Lake Xiao


这篇关于使用MSVC 2015进行编译时即使使用/MD加载许多DLL也会导致ERROR_DLL_INIT_FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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