作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在尝试构建时收到以下错误:
1> MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1> G:\CMPSC 101\Projects\Project 2\Project2\Debug\Project2.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
这里是我在cpp文件中写的代码:
// Source file name: Project2.cpp
// This program determines a user's target heart rate and body mass index
// when the user's age, height, and weight are input
// Date written: 27 Feb 2014
// Date modified: 3 Mar 2014
#include <iostream>
using std::cout;
using std::endl;
#include <iostream>
using namespace std;
int main()
{
//age is the input variable from user, target_heart_rate is output after calculation
int age, target_heart_rate;
int weight;
int height, bmi;
//Display Program Introduction and Credits
cout << "Happy Valley Health Club" << endl;
cout << "Target Heart Rate Calculator" << endl;
cout << "Written by Paul D. Wagaman" << endl;
//Display Target Heart Rate Formula
cout << "Your Target Heart Rate is 70% of (220 - your age)" << endl;
//Prompt User to enter their age as a whole number
cout << "Please enter your age as a whole number" << endl;
//User inputs their age
cin >> age;
//Display Body Mass Index Formula
cout << "BMI (kg/m2) = [Weight (lbs) x 703] / Height (in2)" << endl;
//Prompt User to enter their age as a whole number
cout << "Please enter your weight (in pounds) as a whole number" << endl;
//User inputs their age
cin >> weight;
//Prompt User to enter their age as a whole number
cout << "Please enter your height (in inches) as a whole number" << endl;
//User inputs their age
cin >> height;
//Perform target heart rate calculation
//70% of ( 220 - age )
target_heart_rate = ((70 * (220-age))/100);
//Perform BMI calculation
//70% of ( 220 - age )
bmi = (weight * 703) / (height * height);
//Display user’s target heart rate
cout << "70%" << " ( " << "220" << " - " << age << " ) " << " = " << target_heart_rate << endl;
cout << "Your target heart rate is " << target_heart_rate << " beats per minute." << endl;
//Display user’s body mass index
cout << "Your BMI formula = (" << weight << "pounds" << " x " << "703)" << " / " << " ( " << height << " squared." << endl;
cout << "Your individual Body Mass Index is " << bmi << endl;
//Display “Thank You” message
cout << "Thank you for choosing Happy Valley Health Club – We care about YOUR health!";
return 0;
}
任何人都可以阐明我做错了什么吗?
最佳答案
自从我编写 Windows 应用程序以来已有很长时间了,但这感觉就像您正在创建 Windows 应用程序而不是控制台应用程序,因此您的代码中应该有一个 WinMain ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms633559%28v=vs.85%29.aspx)...
关于c++ - 错误 LMK2019 : unresolved symbol/fatal error LNK1120: 1 unresolved externals,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22156652/
我明白Android LMK是基于Linux OOM的,但是google为什么要开发一个新的算法(LMK)呢? LMK 比原来的 OOM 好吗?还是其他一些技术原因? 最佳答案 您认为它们具有相同的作
我是一名优秀的程序员,十分优秀!