减小VC生成的体积

#include 
//库
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"msvcrt.lib")
//入口函数
#pragma comment(linker, "/ENTRY:EntryPoint")
//对齐方式
#pragma comment(linker, "/FILEALIGN:512")
#pragma comment(linker, "/opt:ref,ICF")
//合并区段
#pragma comment(linker, "/MERGE:.rdata=.data")
#pragma comment(linker, "/MERGE:.text=.data")
#pragma comment(linker, "/MERGE:.reloc=.data")
//设置区段属性
#pragma comment(linker, "/section:.data,RWE")


int WINAPI WinMain( HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int iCmdShow )
{
    MessageBox(0, "sss", "sss", 0);
    return 0;
}

void EntryPoint()
{
    ExitProcess(WinMain(GetModuleHandle(NULL), NULL, GetCommandLine(), SW_SHOWNORMAL));
}

你可能感兴趣的:(MFC基础知识学习)