問題描述
我有一個用非托管 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 的問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!