求助:MSVCRTD.lib(crtexe.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTSt
edony 2013-11-30 10:33:18 #include<iostream>
#include<fstream>
int mian()
{
using namespace std;
char automobile[50];
int year;
double a_price;
double d_price;
ofstream outFile;//creat an object for output
outFile.open("carinfo.txt");//associate with a file
cout<<"Enter the make and model of automobile: ";
cin.get(automobile,50);
cout<<"Enter the model year: ";
cin>>year;
cout<<"Enter the original asking price: ";
cin>>a_price;
d_price=0.913*a_price;
cout<<fixed;
cout.precision(2);
cout.setf(ios_base::showpoint);
cout<<"Make and model: "<<automobile<<endl;
cout<<"Year: "<<year<<endl;
cout<<"Was asking $"<<a_price<<endl;
cout<<"Now asking $"<<d_price<<endl;
outFile<<fixed;
outFile.precision(2);
outFile.setf(ios_base::showpoint);
outFile<<"Make and model: "<<automobile<<endl;
outFile<<"Year: "<<year<<endl;
outFile<<"Was asking $"<<a_price<<endl;
outFile<<"Now asking $"<<d_price<<endl;
outFile.close();
return 0;
}
编译的时候出现问题:
1>------ 已启动生成: 项目: write2file, 配置: Debug Win32 ------
1> 源.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
1>D:\Study\Engineering Program Study\Visual studio project\write2file\Debug\write2file.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
在度娘上查了一下解决办法不管用,控制台和app都试过了。请各位大神帮我看一下是什么问题?
多谢多谢!