- 1、配置path环境变理
- 2、解决找不到mspdb.dll的问题
- 3、配置incluce环境变量
- 4、配置lib环境变量
- 5、写一个MFC程序
- 5、编译
- 6、链接
1、配置path环境变理 2、解决找不到mspdb.dll的问题
运行cl,提示找不到mspdb.dll,如下图
找到mspdb100.dll的位置,拷贝到cl.exe同目录下,即E:Program FilesVS2010VCbin
再次执行cl问题解决。
- 编译时要用到
- 链接时要用到
#include
class CMyframeWnd:public CframeWnd{};
class CMyWinApp:public CWinApp{
virtual BOOL InitInstance();
};
BOOL CMyWinApp::InitInstance(){
CMyframeWnd* pframe=new CMyframeWnd;
m_pMainWnd=pframe;
pframe->Create(NULL,"HelloWorld!");
pframe->ShowWindow(SW_SHOW);
pframe->UpdateWindow();
return TRUE;
}
CMyWinApp theApp;
5、编译
- 编译上面的MFC程序
- 执行命令cl /c /D;_MBCS /EHsc MFC.cpp
- /c 只编译,不链接
- D字符集
- /EHsc捕获异常
- Debug定义宏:_DEBUG
- Release定义宏:NOEBUG
- 多字节字符集:_MBCS
- Unicode定义宏:_UNICODE、UNICODE
link MFC.obj /subsystem:windows



