Websphere MQ C++ client crashes in VS2013- library/linker issues?

六眼飞鱼酱① 提交于 2021-01-27 16:32:04

问题


I just upgraded a project to VS2013 from VS2010 and now it crashes whenever I send a message via MQ, yet it worked fine under VS2010.

I suspected it was something to do with VS2013, so I built one of the demo apps that comes with MQ - imqwrld.cpp which is a simple "hello world" app.

This code alone is enough for the debug runtime library to throw an exception:

 #include <imqi.hpp> // WebSphere MQ C++
 int main ( int argc, char * * argv ) {

    ImqQueue * p = new ImqQueue();
    delete p;
    return 0
 }

when the ImqObject is deleted, the c rtl detects memory corruption.

I suspect it is because of DLL hell. The MQ dlls have a dependency on msvcr80.dll and my program uses a different version of the library - msvcr120d.dll.

Any suggestions on how I can solve this? I'm using MQ client 7


回答1:


Its a current release (up to and including 7.5) bug/restriction - the compiler that MQ produces its C++ libraries from, and the Visual Studio 2012+ compilers are apparently binary incompatible. You cannot solve nor workaround this other than to use the C or .NET API's depending on what you are trying to do...

As @John M Gant commented below, here is the official support page from IBM. BTW, it looks like MQ Series 8.0 is supported for C++ in VS2012



来源:https://stackoverflow.com/questions/20062808/websphere-mq-c-client-crashes-in-vs2013-library-linker-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!