C++ VisualStudio 2010 express Error

I am working on project and have this error how do I fix it ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 // projone.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
double weight;
double height;
cout <<"Enter your weight in pounds :";
cin >> weight;
cout << endl;
cout <<"Enter your height in inches :";
cin >> height;
cout << endl;
cout <<"Weight is given by " << weight << endl;
cout <<"Height is given by " << height << endl;
double bmi = ( weight * 703 ) / ( height * height );
if (bmi < 18.5)
cout << " Underweight " << endl;
else if(bmi < 25)
cout << " Normal " << endl;
else if(bmi < 30)
cout << " Overweight " << endl;
else 
cout << " Obese " << endl; 
return 0;
}



ERROR: 1>------ Build started: Project: projone, Configuration: Debug Win32 ------ 1> projone.cpp 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited on


A console application shouldn't have #include "stdafx.h" . Make sure you create a project as a console application.
Topic archived. No new replies allowed.