0

I've looked into a few questions of this topic already and most of the issues are that there is a reference that was not defined. However, my code here is incredibly simple so what I don't understand is what am I not defining here?

#include <iostream>
using namespace std;
#define RADIUS 5.257
#define PI 3.14159265
int main()
{
    double circleArea;
    circleArea = PI * RADIUS * RADIUS;
    cout << "\n\nThe area is " << circleArea << "\n\n";
    return 0;
}

Any help would greatly be appreciated.

EDIT: Sorry it would seem i forgot the full error code. Here it is:

1>------ Build started: Project: Win32Project2, Configuration: Debug Win32 ------
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>D:\Win32Project2\Debug\Win32Project2.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Mike Gordon
  • 3
  • 1
  • 4

1 Answers1

1

You're compiling your program as a Windows application (that requires WinMain) and not a Console Application (that requires main).

zmbq
  • 38,013
  • 14
  • 101
  • 171