问题描述
我有一个用非托管 C++ 编写的非常简单的 DLL,我可以从我的应用程序访问它.我最近切换到 Visual Studio 2010,DLL 从 55k 减少到 35k,没有代码更改,现在它不再加载到 Windows 2000 中.我没有更改任何代码或编译器设置.我对 0x0500 进行了定义设置,其中应该包括 Windows 2000 支持.有没有其他人遇到过这个问题,或者对我能做什么有任何想法?
I have a very simple DLL written in unmanaged C++ that I access from my application. I recently switch to Visual Studio 2010, and the DLL went from 55k down to 35k with no code changes, and now it will no longer load in Windows 2000. I didn't change any code or compiler settings. I have my defines setup for 0x0500, which should include Windows 2000 support. Has anyone else run into this, or have any ideas of what I can do?
推荐答案
Visual Studio 2010 无法构建在 Windows 2000 上运行的二进制文件.实际上比这更糟糕,它们也不会在 Windows XP RTM 或 Windows XP Service Pack 1 上运行.这是因为 VS2010 的 C 运行时库需要 EncodePointer API,该 API 直到 SP2 才可用.
Visual Studio 2010 cannot build binaries that run on Windows 2000. It's actually even worse than that, they won't run on Windows XP RTM or Windows XP Service Pack 1 either. This is because VS2010's C runtime library requires the EncodePointer API which is not available until SP2.
如果您想支持早期版本的 Windows,您似乎无法安装 VS2008.您可以将整个项目移动到 Visual Studio 2008,也可以从 Visual Studio 2010 项目中定位 vc90 (Visual Studio 2008) 工具集.有关后一种方法的更多详细信息,请参阅我的相关问题的答案 此处.
It appears you're stuck building with installing VS2008 if you want to support earlier versions of Windows. You can either move your entire project to Visual Studio 2008 or you can target the vc90 (Visual Studio 2008) toolset from within your Visual Studio 2010 projects. For more details on the latter method, see this anwser to my related question here.
这篇关于在 Windows 2000 中使用 Visual Studio 2010 编译的 C++ DLL 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!