title: Unresolved External Symbol - Only in Release mode
body: <p>I'm using Visual C++ 6, and my application builds and runs fine in debug mode, but I get these two Unresolved External Symbol errors when trying to build in Release mode:</p>
  
  <pre><code>OverUnderReportDoc.obj : error LNK2001: unresolved external symbol "public: virtual int     __thiscall COverUnderReportDoc::GenerateReport(void)" (? GenerateReport@COverUnderReportDoc@@UAEHXZ)
  
  OverUnderReportDoc.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall COverUnderReportDoc::DoReport(void)" (?DoReport@COverUnderReportDoc@@UAE_NXZ)
  </code></pre>
  
  <p>COverUnderReportDoc is a class derived from CReportDoc, which is derived from CDocument, part of the MFC framework.</p>
  
  <p>Here are the function declarations:</p>
  
  <pre><code>public:
  
  virtual int GenerateReport(void);
  virtual bool DoReport(void);
  </code></pre>
  
  <p>And the definitions:</p>
  
  <pre><code>bool COverUnderReportDoc::DoReport(void)
  {
  
  // Instantiate the dialog
  CCriteriaDlg dlg;
  m_Report.BreakSpace(FALSE);
  
  // Get a pointer to the window
  CWnd* pWnd = AfxGetApp()-&gt;m_pMainWnd;
  
  // When OK is clicked...
  if (dlg.DoModal() == IDOK)
  {       
      // Set the document title
      SetTitle("Inventory Over/Under");
  
      // Copy some values from the dialog to member variables
  
      GenerateReport();
  
      pWnd-&gt;ShowWindow(SW_MAXIMIZE);
  
  }
  else
  {
              // If Cancel is clicked, close the program
      if(pWnd)
          pWnd-&gt;PostMessage(WM_CLOSE);
      return false;
  }
  
  return true;
  }
  
  int COverUnderReportDoc::GenerateReport(void)
  {
  
  // write the headers to the report
  // if there was no problem
  if (DoHeaders())
  {
      // assemble the report data
      // if that went well
      if (ScanFile())
          // write the summary to the report
          DoSummary();
  }
  // return the document status
  return m_nStatus;
  }
  </code></pre>
  
  <p>I'm really not sure how to resolve this, those methods aren't in any libraries, and the class compiles fine, so I don't know why it doesn't see them while linking. Anyone have any ideas?</p>
  
  <p><strong>EDIT:</strong> Here are my project options:</p>
  
  <p><strong>Release Project Options:</strong></p>
  
  <p>(<code>C/C++</code> tab of <code>Project Settings</code>)</p>
  
  <pre><code>/nologo /Zp1 /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D   "_MBCS" /D "BTI_WIN_32" /FR"Release/" /Fo"Release/" /Fd"Release/" /FD /c 
  </code></pre>
  
  <p>(<code>Link</code> tab of <code>Project Settings</code>)</p>
  
  <pre><code>MYLIB.lib w3btrv7.lib VERSION.LIB /nologo /subsystem:windows /incremental:no /pdb:"Release/OverUnderReport.pdb" /machine:I386 /out:"Release/OverUnderReport.exe" 
  </code></pre>
  
  <p><strong>Debug Project options:</strong></p>
  
  <p>(<code>C/C++</code> tab of <code>Project Settings</code>)</p>
  
  <pre><code>/nologo /Zp1 /MDd /W3 /GX /ZI /Ot /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "BTI_WIN_32" /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
  </code></pre>
  
  <p>(<code>Link</code> tab of <code>Project Settings</code>)</p>
  
  <pre><code>VERSION.LIB MYLIB.lib w3btrv7.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"Debug/OverUnderReport.exe" 
  </code></pre>