title: error LNK2001: unresolved external symbol _Main
body: <p>I have some code here that doesn't seem to be linking properly. I have searched, and several places have suggested it is a problem with int main(). Not really sure what my problem is. I am pretty new to programming, and I have tried a few different things. Any help would be great!</p>
  
  <p>I have four files: Wire.h, Wire.cpp, Gate.h, and Gate.cpp.</p>
  
  <p>This is the Wire.h</p>
  
  <pre><code>#ifndef WIRE_H
  #define WIRE_H
  
  #include &lt;iostream&gt;
  #include&lt;vector&gt;
  #include&lt;map&gt;
  #include&lt;string&gt;
  #include "Gate.h"
  
  using namespace std;
  
  class Gate;
  
  class Wire {
  public:
      // constructors
      Wire();
  
      // destructor
      ~Wire();
  
      //functions
      int getState();
      void setState(int s);
  
  private:
      int State;
      vector&lt;Gate*&gt; Gates;
      vector&lt;int&gt; History;
  
  
  };
  
  #endif //WIRE_H
  </code></pre>
  
  <p>This is Wire.cpp:</p>
  
  <pre><code>#include "Wire.h"
  
  #include&lt;iostream&gt;
  using namespace std;
  
  int main() {
      cout &lt;&lt; "Hello World";
      return 0;
  }
  
  Wire::Wire(){
      State = UNKNOWN;
  }
  
  Wire::~Wire(){
  
      for (int i = 0; i &lt; 1/*Gates.size()*/; i++){
          Gates.pop_back();
      }
      for (int i = 0; i &lt; 1/*History.size()*/; i++){
          History.pop_back();
      }
  }
  
  int Wire::getState() {
      return State;
  }
  
  void Wire::setState(int s) {
      State = s;
  }
  </code></pre>
  
  <p>This is Gate.h:</p>
  
  <pre><code>#ifndef GATE_H
  #define GATE_H
  
  #include "Wire.h"
  
  #include &lt;iostream&gt;
  #include&lt;vector&gt;
  #include&lt;map&gt;
  #include&lt;string&gt;
  
  using namespace std;
  const int HI = 1;
  const int LOW = 0;
  const int UNKNOWN = -1;
  
  class Wire;
  
  class Gate {
  public:
  
      // destructor
      ~Gate();
  
      //functions
      void logic();
      void setType(string);
      void setDelay(int);
      void setAIO(int i, int o); //Only for the NOT gate
      void setBIO(int ain, int bin, int o); //For all gates except for NOT
  
  
  private:
      string Type;
      Wire* inputA;
      Wire* inputB;
      Wire* output;
      int delay;
  
  
  };
  
  #endif //GATE_H
  </code></pre>
  
  <p>This is Gate.cpp</p>
  
  <pre><code>#include "Gate.h"
  
  #include&lt;iostream&gt;
  using namespace std;
  
  Gate::Gate(){
      inputA = new Wire();
  }
  
  Gate::~Gate(){
      delete inputA;
      delete inputB;
      delete output;
  }
  
  void Gate::logic(){
      if (Type == "NOT"){
          if (inputA-&gt;getState() == UNKNOWN){
          }
          if (inputA-&gt;getState() == HI){
              output-&gt;setState(LOW);
          }
          if (inputA-&gt;getState() == LOW){
              output-&gt;setState(HI);
          }
      }
      if (Type == "AND") {
          if (inputA-&gt;getState() == HI &amp;&amp; inputB-&gt;getState() == HI){
              output-&gt;setState(HI);
          }
          else {
              output-&gt;setState(LOW);
          }
      }
      if (Type == "OR") {
          if (inputA-&gt;getState() == HI || inputB-&gt;getState() == HI){
              output-&gt;setState(HI);
          }
          else {
              output-&gt;setState(LOW);
          }
      }
      if (Type == "XOR"){
          if (inputA-&gt;getState() != inputB-&gt;getState()){
              output-&gt;setState(HI);
          }
          else
          {
              output-&gt;setState(LOW);
          }
      }
      if (Type == "NAND"){
          if (inputA-&gt;getState() == HI &amp;&amp; inputB-&gt;getState() == HI){
              output-&gt;setState(LOW);
          }
          else{
              output-&gt;setState(HI);
          }
      }
      if (Type == "NOR"){
          if (inputA-&gt;getState() == LOW &amp;&amp; inputB-&gt;getState() == LOW){
              output-&gt;setState(HI);
          }
          else{
              output-&gt;setState(LOW);
          }
      }
      if (Type == "XNOR"){
          if (inputA-&gt;getState() == inputB-&gt;getState()){
              output-&gt;setState(HI);
          }
          else
          {
              output-&gt;setState(LOW);
          }
      }
  }
  
  void Gate::setType(string t){
      Type = t;
  }
  
  void Gate::setDelay(int d){
      delay = d;
  }
  </code></pre>