在x86系统上开发dll并在x64上运行它-运行时库错误 [英] Develloping a dll on an x86 system and running it on x64 - runtime library error
问题描述
我编写了一个C ++ dll,可以使用JNI从Java调用它.我的dll在我用于开发的计算机(XP,x86)上运行良好.但是,当我尝试在Windows Server 2008 R2(x64)上使用它时,它将失败.我留下一条通用消息:此应用程序具有 请求运行时以一种异常的方式终止它."我已经使用Visual Studio 2008 Express Edition开发了我的dll.
I have written a C++ dll that i call from Java using JNI. My dll runs fine on the machine i used for development (XP, x86). But when i try to use it on a Windows Server 2008 R2 (x64), it fails. I am left with a generic message: "this application has requested the runtime to terminate it in an unusual way." I have used Visual Studio 2008 Express Edition to devellop my dll.
我尝试过调整项目设置(例如运行时库,使用MFC ...),但没有成功.对于在x86系统上运行的dll在x64上运行,是否应该进行任何配置?
I have tried tweekeing the projecy settings (like runtime library, use of MFC...) but with no success. Are there any configurations one should make for a dll develloped on a x86 system to run on x64?
有人可以向我提供任何建议吗?预先感谢...
Can anyone help me with any advice? Thanks in advance...
推荐答案
我编写了一个C ++ dll,可以使用JNI从Java调用它.我的dll在我用于开发的计算机(XP,x86)上运行良好.但是,当我尝试在Windows Server 2008 R2(x64)上使用它时,它将失败.剩下的是一条通用消息:此应用程序 已请求运行时以一种不寻常的方式终止它.我已经使用Visual Studio 2008 Express Edition开发我的dll.
我尝试过调整项目设置(例如运行时库,使用MFC ...),但没有成功.对于在x86系统上运行的dll在x64上运行,是否应该进行任何配置?
任何人都可以向我提供任何建议吗?预先感谢...
I have written a C++ dll that i call from Java using JNI. My dll runs fine on the machine i used for development (XP, x86). But when i try to use it on a Windows Server 2008 R2 (x64), it fails. I am left with a generic message: "this application has requested the runtime to terminate it in an unusual way." I have used Visual Studio 2008 Express Edition to devellop my dll.
I have tried tweekeing the projecy settings (like runtime library, use of MFC...) but with no success. Are there any configurations one should make for a dll develloped on a x86 system to run on x64?
Can anyone help me with any advice? Thanks in advance...
您是否要从64位进程加载32位DLL?不跳过一些箍圈就无法做到这一点.例如参见
http://www.dnjonline.com/article.aspx?id=jun07_access3264
Are you trying to load your 32-bit DLL from a 64-bit process? This cannot be done without jumping through some hoops. See for example
http://www.dnjonline.com/article.aspx?id=jun07_access3264
这篇关于在x86系统上开发dll并在x64上运行它-运行时库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!