DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  4737 随笔 :: 2 文章 :: 542 评论 :: 1615万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/

App local UCRT DLLs: C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86

经Liigo本人测试,VC2015非静态链接C运行库(/MD)编译的EXE/DLL,在XP SP3系统内,除了依赖以上目录内的(几乎)所有dll以外,还额外依赖vcruntime140.dll。前面提到的这些dll,共计42个,统统放到EXE/DLL所在目录,可确保所有依赖项都不欠缺。这42个dll文件分别是(行首是字节数):

18,624        api-ms-win-core-console-l1-1-0.dll
17,600        api-ms-win-core-datetime-l1-1-0.dll
17,600        api-ms-win-core-debug-l1-1-0.dll
18,104        api-ms-win-core-errorhandling-l1-1-0.dll
21,696        api-ms-win-core-file-l1-1-0.dll
18,112        api-ms-win-core-file-l1-2-0.dll
18,112        api-ms-win-core-file-l2-1-0.dll
18,112        api-ms-win-core-handle-l1-1-0.dll
18,112        api-ms-win-core-heap-l1-1-0.dll
18,104        api-ms-win-core-interlocked-l1-1-0.dll
18,624        api-ms-win-core-libraryloader-l1-1-0.dll
20,672        api-ms-win-core-localization-l1-2-0.dll
18,624        api-ms-win-core-memory-l1-1-0.dll
18,112        api-ms-win-core-namedpipe-l1-1-0.dll
19,136        api-ms-win-core-processenvironment-l1-1-0.dll
20,160        api-ms-win-core-processthreads-l1-1-0.dll
18,624        api-ms-win-core-processthreads-l1-1-1.dll
17,600        api-ms-win-core-profile-l1-1-0.dll
17,600        api-ms-win-core-rtlsupport-l1-1-0.dll
18,112        api-ms-win-core-string-l1-1-0.dll
20,160        api-ms-win-core-synch-l1-1-0.dll
18,624        api-ms-win-core-synch-l1-2-0.dll
19,136        api-ms-win-core-sysinfo-l1-1-0.dll
18,112        api-ms-win-core-timezone-l1-1-0.dll
18,112        api-ms-win-core-util-l1-1-0.dll
19,136        api-ms-win-crt-conio-l1-1-0.dll
22,208        api-ms-win-crt-convert-l1-1-0.dll
18,624        api-ms-win-crt-environment-l1-1-0.dll
20,160        api-ms-win-crt-filesystem-l1-1-0.dll
18,624        api-ms-win-crt-heap-l1-1-0.dll
18,624        api-ms-win-crt-locale-l1-1-0.dll
28,864        api-ms-win-crt-math-l1-1-0.dll
25,792        api-ms-win-crt-multibyte-l1-1-0.dll
72,896        api-ms-win-crt-private-l1-1-0.dll
19,136        api-ms-win-crt-process-l1-1-0.dll
22,720        api-ms-win-crt-runtime-l1-1-0.dll
24,256        api-ms-win-crt-stdio-l1-1-0.dll
24,256        api-ms-win-crt-string-l1-1-0.dll
20,672        api-ms-win-crt-time-l1-1-0.dll
18,624        api-ms-win-crt-utility-l1-1-0.dll
917,184       ucrtbase.dll
85,328        vcruntime140.dll

Windows Kits 10可通过VC2015安装包安装,vcruntime140.dll文件可从安装过vc_redist.x86.exe for vc2015的系统System32目录中提取。见附件vc2015-rtl-x86.7z。64位的另外一套,但文件名称是一致的。

把这么一大堆dll放到应用程序目录也挺尴尬的(放入单独的\bin子目录可有所缓解)。微软推荐的方法是额外安装vc_redist.exe(却也是麻烦了一步)。很多开发者还是希望把单个dll运行库(如msvcrt.dll)放到应用目录的,方便部署。这个死微软佬,到了VC2015,非要把运行库拆分出几十个dll(其实合起来才几百KB [注1]),一开始甚至是拒绝提供App Local DLLs的,被抗议太多了才被迫妥协(详见上文链接)。观望VC2016(即VC15)的策略。

注1: 非压缩版1.75MB,zip压缩后911KB,7zip压缩后435KB。

VC 2015静态链接C运行库(/MT)编译的EXE/DLL,运行时不依赖任何C运行库。微软似乎并不太愿意推荐这种编译方式。

posted on   DoubleLi  阅读(1024)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2013-11-18 GDI泄露检测
2013-11-18 对开发中常见的内存泄露,GDI泄露进行检测
2013-11-18 工作学习笔记——GDI泄露检测利器
2013-11-18 查GDI对象泄露的利器:GDIView
2013-11-18 解决绘图时闪烁问题的一点经验
2013-11-18 精通 VC++ 实效编程280例 - 01 窗口
2011-11-18 CSS布局之-盒子(Box)
点击右上角即可分享
微信分享提示