banner.gif adie's blog
主页 博客 胭脂泪,相留醉,几时重,自是人生长恨水长东
统计
日志总数: 123
评论总数: 138
日志分类
日志归档
最近日志
最近评论
订阅
rss2.gif

atom.gif

google_rss
yc.gif 【技术资料】 阅读 53939 次

VC2015 缩减 MFC 静态链接生成 exe 文件的大小

2015-12-25 16:13:43

建工程的时候一定要选上 No enhanced MFC controls.

如果是从以前版本的工程升级到 2015 的,在 stdafx.h 头文件中加上:

#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS

 

如果建工程的时候没选 No enhanced MFC controls. 之后的修改方法为:

1. stdafx.h 中加上 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS

2. 在 工程名.rc 文件中去掉 #include "afxribbon.rc"   // MFC ribbon and control bar resources

▲评论

› 网友 adie () 于 2016-12-28 16:05:52 发表评论说:
链接时出现错误: >uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "void __cdecl AfxRegisterMFCCtrlClasses(void)" (?AfxRegisterMFCCtrlClasses@@YAXXZ) already defined in afxnmcdd.lib(afxctrlcontainer2.obj) 1>uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "protected: void __cdecl CMFCControlContainer::PreUnsubclassControl(class CWnd *)" (?PreUnsubclassControl@CMFCControlContainer@@IEAAXPEAVCWnd@@@Z) already defined in afxnmcdd.lib(afxctrlcontainer2.obj) 1>uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "public: int __cdecl CMFCControlContainer::SubclassDlgControls(void)" (?SubclassDlgControls@CMFCControlContainer@@QEAAHXZ) already defined in afxnmcdd.lib(afxctrlcontainer2.obj) 1>E:\work\yproject\DbgTools\x64\Debug\MemoryWalker.exe : fatal error LNK1169: one or more multiply defined symbols found 还需要删除和工程同名的 cpp 文件中的 // Create the shell manager, in case the dialog contains // any shell tree view or shell list view controls. CShellManager *pShellManager = new CShellManager; // Activate "Windows Native" visual manager for enabling themes in MFC controls CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); 和 // Delete the shell manager created above. if (pShellManager != NULL) { delete pShellManager; }
› 网友 Alonso (sex:Alonso; email:junior0t@usa.net; web:http://soprof.com.mx; qq:Alonso; from:Alonso; work:Alonso; ) 于 2018-12-11 10:24:01 发表评论说:
I love this site http://www.ccpirapuato.com diflucan Julianne is now a senior at Syracuse University and Tyler a sophomore at Delaware University, while their mother, Cindy, continues to work at PepsiCo in Somers. But whatever sense of normalcy their lives had settled into was shaken recently when they learned Mancusi, 37, had again been charged with drugged driving.
› 网友 Federico (sex:Federico; email:darius6u@lycos.com; web:https://weteachquran.com; qq:Federico; from:Federico; work:Federico; ) 于 2018-12-11 10:24:02 发表评论说:
I'd like to pay this cheque in, please http://ttstaller.com ventolin National Cruise Week, starting today, offers first-timers a chance to find out why cruising is the UK’s fastest-growing holiday, while seasoned cruisers can catch up on exciting new itineraries for 2014. The culture and history of the Mediterranean ports have obvious appeal, but have you considered Arctic adventures near the North Pole or the drama of Norway’s fjords? How about a relaxing cruise around the Caribbean or a voyage east for something more exotic?
› 网友 German (sex:German; email:reinaldop98@gmail.com; web:https://weteachquran.com; qq:German; from:German; work:German; ) 于 2018-12-11 10:24:03 发表评论说:
I'll call back later http://www.ccpirapuato.com cialis Biologist Ian Welch was helping to tag endangered creatures along the Maeklong River in Thailand when he hooked a 771-pound giant stingray on his fishing rod and battled with it for 90 minutes before bringing it aboard his boat. 'As a lifelong angler and biologist it is great my passions have come together,' the 45-year-old scientist said. The stingray was later released.
› 网友 Heath (sex:Heath; email:migueldmt@lycos.com; web:http://ttstaller.com; qq:Heath; from:Heath; work:Heath; ) 于 2018-12-11 10:24:05 发表评论说:
Have you read any good books lately? http://soprof.com.mx kamagra “This is perfect for live music events, more sentimental moments such as childrens' first steps and much more. Autographer ensures that the best moments which may have otherwise been missed are completely captured.”
› 网友 Harley (sex:Harley; email:hipolito0l@yahoo.com; web:http://www.ccpirapuato.com; qq:Harley; from:Harley; work:Harley; ) 于 2018-12-11 10:24:06 发表评论说:
I came here to work https://matrixglobal.net.id ventolin The new guidelines will not place formal new restrictions on prescriptions by physicians who treat patients for pain, but administration officials announcing the change made clear they hope to chasten physicians who prescribe the medications for anything other than ongoing, intractable pain.
X 正在回复:
姓 名: 留下更多信息
性 别:
邮 件:
主 页:
Q Q:
来 自:
职 业:
评 论:


Valid HTML 4.01 Strict Valid CSS!
Copyleft.A!die Software Studio.ADSS
Power by webmaster@adintr.com