microsoft / Xbox-GDK-Samples

Game development samples published by the Xbox Advanced Technology Group using the Microsoft GDK.
http://aka.ms/gamedevdocs
MIT License
218 stars 32 forks source link

Can I build GamepadVibration with C/C++ runtime compiler option /MT? #28

Closed luqiming666 closed 1 year ago

luqiming666 commented 1 year ago

As we can see, the original configuration is /MD. After I changed DirectXTK12 and GamepadVibration to use /MT, I got the following linker errors:

2>libHttpClient.142.GDK.C.lib(global_publics.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MT_StaticRelease”(GamepadVibration.obj 中) 2>libHttpClient.142.GDK.C.lib(httpcall_publics.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MT_StaticRelease”(GamepadVibration.obj 中)

Does GDK have MT_StaticRelease version of libs?

walbourn commented 1 year ago

Generally speaking, the Microsoft GDK does not fully support using CRT static linking. This usage is discouraged for a number of reasons: code size, code duplication, security servicing, mixed CRT versions at runtime, etc.

Several of the extension libraries are only provided in DLL format so they will link the same /MD and /MT, but the two C++ static libraries are only provided in /MD form so will fail to link with /MT.