在vs2013中出现的问题。error LNK2019 error LNK1120
错误1errorLNK2019:无法解析的外部符号_WinMain@16,该符号在函数___tmainCRTStartup中被引用C:\Users\Jerry\Deskt...
错误 1 error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用 C:\Users\Jerry\Desktop\C++\Win32Project2\Win32Project2\MSVCRTD.lib(crtexew.obj) Win32Project2
错误 2 error LNK1120: 1 个无法解析的外部命令 C:\Users\Jerry\Desktop\C++\Win32Project2\Debug\Win32Project2.exe Win32Project2
#include<iostream>
using namespace std;
class Rectangle
{
public:
Rectangle(float len, float width)
{
Length = len;
Width = width;
}
~Rectangle(){};
float GetArea(){ return Length * Width; }
float GetLength(){ return Length; }
float GetWidth(){ return Width; }
private:
float Length;
float Width;
};
int main()
{
float length, width;
cout << "PLEASE INPUT LENGTH:";
cin >> length;
cout << "PLEASE INPUT WIDTH:";
cin >> width;
Rectangle r(length, width);
cout << "长为" << length << "宽为" << width << "的矩形面积为:"
<< r.GetArea() << endl;
} 展开
错误 2 error LNK1120: 1 个无法解析的外部命令 C:\Users\Jerry\Desktop\C++\Win32Project2\Debug\Win32Project2.exe Win32Project2
#include<iostream>
using namespace std;
class Rectangle
{
public:
Rectangle(float len, float width)
{
Length = len;
Width = width;
}
~Rectangle(){};
float GetArea(){ return Length * Width; }
float GetLength(){ return Length; }
float GetWidth(){ return Width; }
private:
float Length;
float Width;
};
int main()
{
float length, width;
cout << "PLEASE INPUT LENGTH:";
cin >> length;
cout << "PLEASE INPUT WIDTH:";
cin >> width;
Rectangle r(length, width);
cout << "长为" << length << "宽为" << width << "的矩形面积为:"
<< r.GetArea() << endl;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询