首先建立一个空的win32 console Application工程项目.
然后在Resource Files中Add一个新的item输入:
#include <iostream>
using namespace std;
int main(){
int n;
cout<<"hello world!"<<endl<<endl;
cout<<"谷卫兵.2009.09.18"<<endl;
cin>>n;//仅仅是为了在命令提示窗口能够看到运行的结果.暂停的一个作用.
return 0;
}
这个时候将编译好的程序在其他电脑上面是不能够直接运行的.
作修改:
1.Project->Property->configuration Properties->General->Use of MFC
修改成Use MFC in a Static Library
编译的时候会提示一个错误:
1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\A.exe.embed.manifest". Bpcn
解决这个问题的方法:
在项目上点击右键,选择清理(Clean),这样就可以搞定了.
再Debug一下.将编译好的程序在其他的电脑上面就可以直接运行了.OK.