_mktemp_s is only available with Visual Studio 2005 runtime, not the system msvcrt.dll in XP. As result any program compiled with _mktemp_s will not run in Windows XP. Windows 7 or later (I am not sure about vista) has an updated msvcrt.dll that does not have this problem.
Please add WINVER or _WIN32_WINNT guard to this function to reflect the fact. Some projects have build-in _mktemp_s workaround, and works fine when _mktemp_s is missing, if you make _mktemp_s available to the wrong target OS, that is actually causing problem.