【发布时间】:2015-12-21 11:12:39
【问题描述】:
#include <iostream>
#include <string>
using namespace std;
int main()
{
// declare variables
string name;
float fahrenheit, celcius;
//display greeting
cout << "Please enter your first name: ";
cin >> name;
//ask for fahrenheit
cout << "Enter a temperature in Fahrenheit degrees please: ";
cin >> fahrenheit;
//write equation
celcius = 5.0f/9.0f * (fahrenheit - 32.0f);
//display result
cout << "Hi " << name << endl << endl;
cout << "The equivalent to " << fahrenheit << "degrees Fahrenheit is" << celcius << "degrees Celcius" << endl << endl;
return 0;
}
我不确定到底是什么不正确我已经检查了很多次并使用代码来消除错误无济于事。任何帮助表示赞赏。
【问题讨论】:
-
具体的错误信息是什么?
-
1>MSVCRTD.lib(crtexew.obj):错误 LNK2019:未解析的外部符号 _WinMain@16 在函数 ___tmainCRTStartup 1>C:\Users\Nora\Documents\Visual Studio 2008\Projects\Project1 中引用\lab2T13\Debug\lab2T13.exe : 致命错误 LNK1120: 1 unresolved externals
-
我觉得你需要把项目配置成控制台项目(不是win32应用)
-
我按照教授的指示使用的是win32,所以没有改变
-
和你教授谈谈。