标题:vs2010 :1 个无法解析的外部命令
取消只看楼主
lijunbo
Rank: 1
等 级:新手上路
帖 子:13
专家分:8
注 册:2011-10-5
结帖率:100%
已结贴  问题点数:5 回复次数:0 
vs2010 :1 个无法解析的外部命令
编译时提示:
1>LINK : error LNK2001: 无法解析的外部符号 _mainCRTStartup
1>D:\c++工程\第一章\Debug\第一章.exe : fatal error LNK1120: 1 个无法解析的外部命令

在命令行可以编译通过,但是有警告:c4530:使用了c++异常处理程序,但未启用展开语义。请定义 /EHsc
请教各位高人,问题出在哪里?因如何修改?
程序代码如下:

#include<iostream>
#include<cstdlib>
#include<fstream>
#include<string>
#include<iterator>
#include<algorithm>
using namespace std;

int main()
{
string fileName;
cout<<"Enter the file name:"<<endl;
cin>>fileName;
ifstream inFile(fileName.c_str());
if(!inFile){
cout<<"Can not open file: "<<fileName<<endl;
return EXIT_FAILURE;

}
ostream_iterator<string> outIter(cout, " ");
istream_iterator<string> inIter(inFile),eof;
copy(inIter,eof,outIter);
inFile.close();
return 0;
}
搜索更多相关主题的帖子: 工程 include 
2011-12-21 13:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-358286-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.138104 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved