是什么导致了这个错误?我用谷歌搜索了它,我发现的前几个解决方案是库和主要功能有问题,但在我的问题上似乎都很好,我什至都重新输入了!这可能是什么原因造成的?
这可能会有所帮助:
MSVCRTD.lib(crtexew.obj):错误 LNK2019: 函数 _ _tmainCRTStartup 中引用的未解析外部符号 WinMain@16
#include <iostream>
using namespace std;
int main()
{
const double A = 15.0,
B = 12.0,
C = 9.0;
double aTotal, bTotal, cTotal, total;
int numSold;
cout << "Enter The Number of Class A Tickets Sold: ";
cin >> numSold;
aTotal = numSold * A;
cout << "Enter The Number of Class B Tickets Sold: ";
cin >> numSold;
bTotal = numSold * B;
cout << "Enter The Number of Class C Tickets Sold: ";
cin >> numSold;
cTotal = numSold * C;
total = aTotal + bTotal + cTotal;
cout << "Income Generated" << endl;
cout << "From Class A Seats $" << aTotal << endl;
cout << "From Class B Seats $" << bTotal << endl;
cout << "From Class C Seats $" << cTotal << endl;
cout << "-----------------------" << endl;
cout << "Total Income: " << total << endl;
return 0;
}
原文由 Howdy_McGee 发布,翻译遵循 CC BY-SA 4.0 许可协议
来自 msdn