Chuyu-Team / VC-LTL5

Shared to msvcrt.dll or ucrtbase.dll and optimize the C/C++ application file size.
Eclipse Public License 2.0
499 stars 48 forks source link

C++ example InstructionSet.cpp does not run on Windows XP: LTL build imports NT6 API call #62

Closed wesinator closed 6 months ago

wesinator commented 6 months ago

Example https://learn.microsoft.com/cpp/intrinsics/cpuid-cpuidex?view=msvc-170#example

The statically linked binary targeting msvcrt 5.1 (size ~62kb) does not run on NT 5.1 / Windows XP, because it still tries to load a NT6+ only API call. (https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-lcidtolocalename#requirements) image This code works if:

Thanks,

mingkuang-Chuyu commented 6 months ago

please install YY-Thunks and use /MT

VC-LTL + YY-Thunks, use them together to be compatible with Windows XP.

mingkuang-Chuyu commented 6 months ago

In order to reduce the file size of the VC-LTL library, starting from version 5.0, VC-LTL is no longer responsible for API dependency issues. (Have you noticed that VC-LTL 5.0 is only one-tenth the size of the previous version?)

That's why we need to use YY-Thunks, which focuses on solving these API dependency problems.

wesinator commented 6 months ago

Thanks - I was confused because the description in the "About" section of YY-Thunks only said "XP RTM"

mingkuang-Chuyu commented 6 months ago

Thanks - I was confused because the description in the "About" section of YY-Thunks only said "XP RTM"

I'm sorry that the documentation is incorrect.