title: VC++errors LNK 2019 LNK 1120
body: <p>I'm building a school project that uses ICloneable.  It's a very straight forward project, but I can't seem to be able to get passed this error:</p>
  
  <pre><code>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in   function ___tmainCRTStartup
  1&gt;C:\Users\Ed\Documents\Visual Studio 2012\School_Projects\Cpp   Programs\CppInterfaceProgramming\Debug\CppInterfaceProgramming.exe : fatal error LNK1120: 1   unresolved externals
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 
  </code></pre>
  
  <p>The project is set up as a CLR console application using VS2012.  I'm sure that I've selected the correct application.</p>
  
  <p>This is the code that is giving me the problem:</p>
  
  <pre><code>/*
  TestCloning class provides for testing of Circle and Square classes
  
  */
  #include "stdafx.h"
  #include "Square.h"
  #include "Circle.h"
  
  using namespace System;
  
  ref class TestCloning
  {
  private: static ConsoleKeyInfo^ cki;
       static Object^ Copy (ICloneable^ o)
       {
           Object^ newObject = o-&gt;Clone();
           return newObject;
       }
  
       static void main()
       {
           while (true)
           {
               copyOrExit();
               if (cki-&gt;ToString() == "S")
               {
                   displayAndCopySquare();
               }
               else if (cki-&gt;ToString() == "C")
               {
                   displayAndCopyCircle();
               }
               else if (cki-&gt;Key == ConsoleKey::Escape)
               {
                   Environment::Exit(0);
               }
           }// while
       } // main
  
       // provide prompt for user to copy object or exit
       static void copyOrExit()
       {
           Console::WriteLine(L"Press the Escape key to exit, S to display and copy a Square object, " +
               "or C to display and copy a Circle object. ");
           cki = Console::ReadKey(true);
           Console::WriteLine(L"\n");
       } // end copyOrExit method
  
       // method to display and copy features of a square based on user input
       static void displayAndCopySquare()
       {
           String^ userInput;
           bool isNum;
           double sideLength = 0;
  
           while (true)
           {
               Console::WriteLine(L"Please enter a number representing the length of one side of a squareto "+
                   "examine and copy...");
               userInput = Console::ReadLine();
               isNum = double::TryParse(userInput, sideLength);
  
               if (isNum)
               {
                   sideLength = double::Parse(userInput);
                   break;
               }
               else
               {
                   Console::WriteLine(L"The value you entered is not a qualified value.  Please try again...");
                   Console::WriteLine("");
               }
           }// while (true)
  
           // create Square object and display
           Square^ mySquare = gcnew Square(sideLength);
  
           Console::WriteLine("The length of one side of this square is " + mySquare-&gt;Side);
           Console::WriteLine("The perimeter of this square is " + mySquare-&gt;Perimeter);
           Console::WriteLine("The area of this square is " + mySquare-&gt;Perimeter);
  
           // clone square to new object and display
           ICloneable^ clonedSquare = mySquare;
           Square^ newSquare = (Square^)Copy(clonedSquare);
           Console::WriteLine(L"The length of one side of the square clone is " + newSquare-&gt;Side);
           Console::WriteLine(L"The perimeter of the square clone is " + newSquare-&gt;Perimeter);
           Console::WriteLine(L"The area of the square clone is " + newSquare-&gt;Area);
           Console::WriteLine(L"\n");
  
       } // end of displayAndCopySquare method
  
       // method to display and copy features of a circle based on user input
       static void displayAndCopyCircle()
       {
           String^ userInput;
           double radius = 0;
           bool isNum;
  
           while (true)
           {
               Console::WriteLine(L"Please enter an integer representing the radius of a circle to examine and copy");
               userInput = Console::ReadLine();
               isNum = double::TryParse(userInput, radius);
               if (isNum)
               {
                   radius = double::Parse(userInput);
                   break;
               }
               else
               {
                   Console::WriteLine(L"The value you entered is not a qualified value.  Please try again...");
                   Console::WriteLine(L"\n");
               }
           } // while loop
  
           // create circle object and display
           Circle^ myCircle = gcnew Circle(radius);
           Console::WriteLine(L"The radius of this circle is " + myCircle-&gt;Radius);
           Console::WriteLine(L"The circumference of this circle is " + myCircle-&gt;Circumference);
           Console::WriteLine(L"The area of this circle is " + myCircle-&gt;Area);
  
           // clone circle to new object and display
           ICloneable^ clonedCircle = myCircle;
           Circle^ newCircle = (Circle^)Copy(clonedCircle);
           Console::WriteLine(L"The radius of this circle clone is " + newCircle-&gt;Radius);
           Console::WriteLine(L"The circumference of this clircle clone is " + newCircle-&gt;Circumference);
           Console::WriteLine(L"The area of this circle clone is " + newCircle-&gt;Circumference);
           Console::WriteLine(L"\n");
       } // end displayAndCopyCircle
  };
  </code></pre>