同步操作将从 初雨团队/VC-LTL 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
I would like to turn into a stone bridge, go through 500 years of wind, 500 years of Sun, rain for 500 years, but she walked off a bridge!
VC-LTL is an open source CRT library based on the MS VCRT that reduce program binary size and say goodbye to Microsoft runtime DLLs, such as msvcr120.dll, api-ms-win-crt-time-l1-1-0.dll and other dependencies.
VC-LTL was originally a dedicated Dism++ runtime and was isolated and open sourced from Dism++ source code on Mar 6, 2017.
There are plenty of modules in large projects. If all binaries uses static compilation, it will use plenty of disk space and finally may crashed because of the fiber local storage (FLS) limitation.
But the VC-LTL can make your project using the built-in msvcrt.dll
in the
Windows. It solves the C runtime deployment problem and the fiber local storage
(FLS) limitation problem effectively, and greatly reduce the binaries size.
What a handy library!
Everyone can use it for free, even for the commerical use. Of course, I hope that if you mentioned the VC-LTL in your project, because I want to help more people.
After using the VC-LTL, the binaries will be dynamically linked to the built-in
msvcrt.dll
in the Windows to reduce the binaries size. It is generally
available if you use the VC-LTL in the project using the C Runtime and the STL.
However you cannot use the VC-LTL in the MFC project with the VC-LTL because it
is too complex to support.
After using the VC-LTL, the size of the binaries will reduce about 30% if compiled from the C++ source code, and about 50% if compiled from the pure C source code.
Let's say goodbye to the Visual Studio 2008.
Module | XP Mode | Vista Mode | UCRT Mode | Files |
---|---|---|---|---|
CRT | 94.716% | 96.347% | 100% | vcruntime.lib, libvcruntime.lib, msvcrt.lib, msvcmrt.lib, msvcrt_Platform.lib, libucrt.lib, ucrt.lib, libucrt_shared.lib, vc.lib |
STL | 100% | 100% | 100% | libcpmt.lib, msvcprt.lib |
ConcRT | 100% | 100% | 100% | libconcrt.lib, concrt.lib |
WinRT | X | 100% | X | vccorlib.lib (Windows 8.1 or later) |
ATL | 100% | 100% | 100% | - |
MFC | X | X | 100% | - |
AMP | - | - | - | - |
OpenMP | 100% | 100% | 100% | Requires vcomp140.dll from the Visual C++ Runtime |
Build Tool | Helper |
---|---|
Visual Studio | VC-LTL helper for Visual Studio.props |
CMake | VC-LTL helper for cmake.cmake |
NMake, CL | VC-LTL helper for nmake.cmd |
QMake | VC-LTL helper for qmake.pri |
OS | x86 | x64 | arm | arm64 |
---|---|---|---|---|
Windows XP, Windows Server 2003 | √ | √ | - | - |
Windows Vista, Windows Server 2008 | √ | √ | - | - |
Windows 7, Windows Server 2008 R2 | √ | √ | - | - |
Windows 8, Windows Server 2012, Windows RT | √ | √ | √ | - |
Windows 8.1, Windows Server 2012 R2, Windows RT 8.1 | √ | √ | √ | - |
Windows 10, Windows Server 2016, Windows Server 2019 | √ | √ | √ | √ |
The binaries compiled with the VC-LTL is compatible with Windows XP and later, even in the environment which installed no hotfixes.
We will enter the theme, we have prepared a rich VC-LTL Samples for your reference, and welcome to join our QQ group (633710173).
If you download and unzip VC-LTL Binary to D:\Src\VC-LTL
, please double-click D:\Src\VC-LTL\Install.cmd
.
The script will save the information in the registry
HKCU\Code\VC-LTL
.
Copy VC-LTL helper for Visual Studio.props
to your project, then open the Property Manager ( View - Property Manager ) and right-click on the Release Configuration, click on Add Existing Property Sheet...
, and finally select VC-LTL helper for Visual Studio.props
.
Runtime Library
adjust to Multi-threaded (/MT)
For XP support, please use the
Windows XP toolset
in the platform toolset, or modifyVC-LTL helper for Visual Studio.props
to enable<SupportWinXP>true</SupportWinXP>
.
Copy VC-LTL helper for cmake.cmake
to your project. Then add include("VC-LTL helper for cmake.cmake")
to CMakeLists.txt
.
Example:
cmake_minimum_required(VERSION 3.5.2)
project(ltltest)
include("VC-LTL helper for cmake.cmake")
add_subdirectory(src)
Make sure to use
/MT
to compile project when using VC-LTL. For XP support, please modifyVC-LTL helper for cmake.cmake
to enableset(SupportWinXP "true")
.
Copy VC-LTL helper for nmake.cmd
to your project. Run vcvars32.bat
or vcvars64.bat
and execute this script. The script will automatically modify the include
and lib
environment variables.
Example:
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
call "D:\VC-LTL\VC-LTL helper for nmake.cmd"
nmake /f Test.mak
Make sure to use
/MT
to compile project when using VC-LTL. For XP support, please modifyVC-LTL helper for nmake.cmd
to enableset SupportWinXP=true
.
Is the file size smaller? If you fail to compile, please refer to 4. FAQ. You can also feedback and work together to improve VC-LTL.
If VC-LTL is referenced correctly, it will be output at the time of generation: note: 进入ltl普通模式,已准备引用到VC-LTL。定义 _DISABLE_DEPRECATE_LTL_MESSAGE 可关闭信息提示。
.
Compile with VC-LTL must be compiled with
/MT
, and all dependent static libraries must also be recompiled with VC-LTL.
未正确引用VC-LTL。建议看看生成日志,是否包含:note: 进入ltl普通模式,已准备引用到VC-LTL。定义 _DISABLE_DEPRECATE_LTL_MESSAGE 可关闭信息提示。
1:请务必确保 VC-LTL helper for Visual Studio.props
已经添加到工程。
2:确保以下设置正确:
没有正确引入vc.lib、msvcrt_Platform.lib。
引入了没有使用VC-LTL编译的静态lib文件。
使用VC-LTL重新编译对应的静态lib(具体lib名称错误日志会给出)。
_CRT_STDIO_SIZE_MAX
宏。(4.0.2.5 Advanced模式已经修正此问题)%ll
。当你需要兼容XP时,请优先考虑使用%I64
代替。(4.0.2.5 Advanced模式已经修正此问题)setlocale/_create_locale
相关函数不支持UCRT的locale name,使用时必须按VC 2008规范使用,比如 setlocale(0, "chs");
这样调用,而不是传入 setlocale(0, "zh-CN");
。/d2FH4
VS2019新增功能)实现过程中使用了TLS,因此在兼容“Windows XP(2003) x64”时请务必确保不要在DllMain中使用FH4 catch,否则将导致dll直接加载失败。Project | Note |
---|---|
NSudo | 一个强大的系统管理工具。VC-LTL的帮助下减少30%的程序体积,包括NSudo for arm64。 |
Menu98 | 经典样式可自定义的开始按钮右键菜单。使用VC-LTL移除运行时依赖。 |
壁虎浏览器 | 一款专业解决DNS劫持的浏览器。使用VC-LTL有效减少程序体积,减少安装包大小。 |
librech551 | 开源跨平台的CH55x ISP软件。使用VC-LTL移除运行时依赖。 |
Dism++ | Dism GUI版。初雨团队自身项目,使用VC-LTL有效减少程序体积,减少安装包大小。 |
360安全卫士 | 奇虎360推出的上网安全软件。360EvtMgr.exe、360leakfixer.exe、360Util.dll、leakrepair.dll等文件使用VC-LTL编译,在VC-LTL的支持下:升级新编译器,减少文件尺寸,完美兼容WinXP,一箭三雕。 |
*_p
系列函数定义,以免使用*_p
系列函数时编译不通过。_except_handler4_common
(感谢 HwangBae)。__argc
、__argv
、__wargv
、_environ
、_wenviron
全局变量问题(感谢 亮叔叔)。_difftime64
时Windows XP无法运行。_msvcrt.cpp
始终会引入urct_14393.lib问题(感谢 亮叔叔)。本次更新后,FastCopy、winpck相关程序直接可以使用VC-LTL编译。
16299已经发布,因此移除老版本14393支持。相关项目请迁徙到15063或者最新16299。
_fstat32
、_fstat32i64
、_fstat64i32
、_stat32
、_stat32i64
、_stat64i32
、_wstat32
、_wstat32i64
、_wstat64i32
导致编译不通过问题。__acrt_iob_func
始终返回输入流问题。_libm_sse2_tan_precise
,_libm_sse2_sqrt_precise
,_libm_sse2_sin_precise
(感谢 stsm85)。_configthreadlocale
、_get_current_locale
、_create_locale
、_free_locale
接口支持。_time32
、_fseeki64
静态实现。_getpid
、_sys_nerr
、_sys_errlist
无法使用问题(感谢 HwangBae)。本次更新主要添加对Vistual Studio 2017 15.5以及更高版本新增的C++ 17功能支持。
__crtLCMapString
相关字符串操作兼容性问题(感谢 Too Simple)。_getptd_noexit
在获取msvcrt.dl的DllMain中创建的 ptd结构时会返回失败问题(感谢 亮亮)。_set_abort_behavior
maybe output a warning message (Thanks myfreeer).nothrow
symbol conflict problem.__p__*
functions (Thanks 昌平).Shared.props
rename to VC-LTL helper for Visual Studio.props
and improve support.VC-LTL helper for nmake.cmd
, provide NMake support.VC-LTL helper for cmake.cmake
, provide CMake support (Thanks Sandro).gets
symbol ( Thanks npc ).VC-LTL removed all libs already, please download VC-LTL Binary then compile your project(s).
__p__fmode
symbol (Thanks augustheart).corecrt.h
will be reported C4828 warning (Thanks to 临渊羡鱼乎).The new VC-LTL 4.0, code-named "Dawning" has been released. As a major version upgrade, you need to pay attention to the following items:
- Beginning with VC-LTL 4.0, if you need static compilation (dependent msvcrt.dll only), please use
/MT
.- VC-LTL 4.0 is not compatible with VC-LTL 3.X compiled static libraries, you need to recompile with VC-LTL 4.0 (Dawning).
/MD
link to DLL such as ucrtbase_ltl.dll
.quick_exit
, __stdio_common
, etc.Minimum required version
in XP mode._libm_sse2_tan_precise
(Thanks to 13732650)./sdl
and avoid using STL crash (Thanks to 漆黑の牙)._byteswap_ulong
, _byteswap_uint64
and _byteswap_ushort
were not found when the internal function was disabled (Thanks to wangwenx190)._abs64
, _rotl64
and _rotr64
functions when internal functions was disabled.wcstold
、_wcstof_l
、_wcstod_l
、_wcstold_l
、_strtod_l
(xp) and _strftime_l
(Vista)._Atexit
function depends on EncodePointer
problem (Thanks to 亮亮).EncodePointer
in Microsoft's original details::Etw._initialize_onexit_table_downlevel
(Thanks to g-qa-ck).operator new(size_t,int,char const *,int) and operator new[](size_t,int,char const *,int)
entry point (Thanks to 希望).delete[](void *, std::nothrow_t const &)
(Thanks to Too Simple)._IsExceptionObjectToBeDestroyed, _CreateFrameInfo, _FindAndUnlinkFrame
to Windows XP (Thanks to 夏思畅).pplerror.cpp
problem (Thanks to xspeed1989).VC-LTL helper for qmake.pri
to provide support for QMake (Thanks to GPBeta).advapi32.lib
, which may cause symbols such as ImpersonateSelf
to be unresolvable (Thanks to 昌平517).std::thread
depends on GetLogicalProcessorInformation
causing XP RTM report not to find entry point (Thanks to 小古)._mbsinc
in XP mode because the old version of msvcrt.dll has an out-of-bounds access the bug (Thanks to 亮亮).std::mutex
depends on GetNumaHighestNodeNumber
causing XP RTM report not to find entry point._downlevel
suffix (Thanks to 过客).VC-LTL helper for qmake.pri
is compatible with the old version of QMake (Thanks to BigBrother)._ATL_XP_TARGETING
and _USING_V110_SDK71_
macros in Vista mode are adjusted from error to warning.__wcsrtombs_utf8
symbol (Thanks To 水边)._splitpath_s, _wsplitpath_s
bug in Windows XP mode (Thanks To 水边)._CRT_STDIO_ISO_WIDE_SPECIFIERS
macro and legacy_stdio_definitions.lib
support (Thanks to BigBrother)._initialize_invalid_parameter_handler
, _initialize_denormal_control
and _get_startup_thread_locale_mode (Vista mode only)
support。_atoi_l, _strtol_l, _atoflt_l, _atoldbl_l
, etc. to Windows XP mode._create_locale、_wcreate_locale、_get_current_locale
to Windows XP mode.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。