C Program Written in VS2012 Works w/ Win7/8/2008R2/2012, but not 2003/XP/32bit?

后端 未结 3 1433
野的像风
野的像风 2021-02-08 15:16

I have to start by saying that I am very much a programming noob. I do not understand all the compiler options or nuances of the IDE, not by a longshot. But I am trying to teach

3条回答
  •  独厮守ぢ
    2021-02-08 15:37

    VS2012 originally shipped without supporting XP/2003. The updated CRT and runtime support libraries are using too many Windows api functions that are not available on those operating systems. This created quite a stir among its customers, to put it mildly, and they re-engineered the libraries to dynamically bind to these functions and limp along it they are missing. This was made available in Update 1, you'll need to use Project + Properties, General, Platform Toolset = v110_xp to build programs that use those libraries.

    Note how it changes a linker setting, the important one, Linker > System > Minimum Required Version = "5.01". Which ensures that the executable file is marked to be compatible with the XP sub-system version. You'll also build against SDK version 7.1, the last one that is still compatible with XP.

    When you use the default toolset (v110) then you target sub-system 6.00 and SDK version 8. Version 6.00 was the last major kernel revision, started with Vista.

    A brief overview of the new api functions being used to give you a (very rough) idea what is missing in the XP version:

    • FlsAlloc, FlsFree, FlsGetValue, FlsSetValue : safe thread-local storage
    • InitializeCriticalSectionEx, CreateSemaphoreEx : safety
    • SetThreadStackGuarantee : stability
    • CreateThreadPoolTimer, SetThreadPoolTimer, WaitForThreadPoolTimerCallbacks, CloseThreadPoolTimer : cheaper timers
    • CreateThreadPoolWait, SetThreadPoolWait, CloseThreadPoolWait : cheaper waits?
    • FlushProcessWriteBuffers, GetCurrentProcessorNumber, GetLogicalProcessorInformation : threading
    • FreeLibraryWhenCallbackReturns : stability?
    • CreateSymbolicLink : functionality
    • InitOnceExecuteOnce : unknown
    • SetDefaultDllDirectories : unknown
    • EnumLocalesEx, CompareStringEx, GetDateFormatEx, GetLocalInfoEx, GetTimeFormatEx, GetUserDefaultLocaleName, IsValidLocaleName, LCMapStringEx : better locale support

提交回复
热议问题