Dev C++ [Linker error]
#include <iostream>
using namespace std;
int Main()
{
int num1;
int num2;
int num3;
int num4;
int average;
num1 = 125;
num2 = 28;
num3 = -25;
num4 = 10;
average = (num1 + num2 + num3 + num4) / 4;
cout << "num1 = " << num1 << endl;
cout << "num2 = " << num2 << endl;
cout << "num3 = " << num3 << endl;
cout << "num4 = " << num4 << endl;
cout << "average = " << average << endl;
system("pause");
return 0;
}
________________________________________________________________________________
Theres my code when i compile it says [Linker error] undefined reference to WinMain@16 id returned 1 exit status. how can i fix this. just so you all know this is for a class debug project but iv been starin at this code for like 4 hours and cant figure out whats goin on with it.
The project is set to be linked to a Windows application, whose entry point looks something like "int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )"; you'll need to change the project setting to link to a "Windows console application". You also shouldn't use Dev-C++, and use something better such as Microsoft Visual Studio 2008 Express or Codeblocks instead.
(Also, main shouldn't be capitalized.)
(Also, main shouldn't be capitalized.)
not sure how to do that i have only been working with Devc++ for a few weeks could it have something to do with being saved on my flash drive? The class instructor wants us to use the DevC++ otherwise i would it sounds like there much better
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement