title: Error generating log file in the win32 console project
body: <p>I have a code to generate a log file :-</p>
  
  <pre><code>// INI.cpp: implementation of the CINI class.
  
  
  //#include "stdafx.h"
  
  #include "INI.h"
  #include &lt;iostream&gt;
  
  #ifdef _DEBUG
  #undef THIS_FILE
  static char THIS_FILE[]=__FILE__;
  #define new DEBUG_NEW
  #endif
  
  
  CINI::CINI(char* szFileName)
  {
  
      memset(m_szFileName, 0x00, 255); 
      memcpy(m_szFileName, szFileName, strlen(szFileName));
  
  }
  
  CINI::~CINI()
  {
  
  }
  
  
  float CINI::ReadFloat(char* szSection, char* szKey, float fltDefaultValue)
  {
      char szResult[255]; 
      char szDefault[255]; 
      float fltResult; sprintf(szDefault, "%f",fltDefaultValue); 
      GetPrivateProfileString(szSection,  szKey, szDefault, szResult, 255, m_szFileName);  
      fltResult =  atof(szResult); return fltResult;
  }
  
  bool CINI::ReadBoolean(char* szSection, char* szKey, bool bolDefaultValue)
  {
      char szResult[255]; 
      char szDefault[255]; 
      bool bolResult; 
      sprintf(szDefault, "%s", bolDefaultValue? "True" : "False"); 
      GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
      bolResult =  (strcmp(szResult, "True") == 0 || strcmp(szResult, "true") == 0) ? true : false; return bolResult;
  }
  
  char* CINI::ReadString(char* szSection, char* szKey, const char* szDefaultValue)
  { 
      memset(m_szResult, 0x00, 255); 
      GetPrivateProfileString(szSection,  szKey, szDefaultValue, m_szResult, 255, m_szFileName);  
      return m_szResult;
  }
  
  void CINI::WriteInteger(char* szSection, char* szKey, int iValue)
  { 
      char szValue[255]; sprintf(szValue, "%d", iValue); 
      WritePrivateProfileString(szSection,  szKey, szValue, m_szFileName);
  }
  
  void CINI::WriteFloat(char* szSection, char* szKey, float fltValue)
  {
      char szValue[255]; 
      sprintf(szValue, "%f", fltValue); 
      WritePrivateProfileString(szSection,  szKey, szValue, m_szFileName);
  }
  
  void CINI::WriteBoolean(char* szSection, char* szKey, bool bolValue)
  { 
      char szValue[255]; sprintf(szValue, "%s", bolValue ? "True" : "False"); 
      WritePrivateProfileString(szSection,  szKey, szValue, m_szFileName);
  }
  
  void CINI::WriteString(char* szSection, char* szKey, char* szValue)
  {
      WritePrivateProfileString(szSection,  szKey, szValue, m_szFileName);
  }
  </code></pre>
  
  <p><strong>I am getting the following errors when I run the code:-</strong></p>
  
  <pre><code>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
  </code></pre>
  
  <p><strong>When I include the StdAfx.h and StdAfx.cpp i get the following errors:-</strong></p>
  
  <pre><code> StdAfx.cpp
  1&gt;c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
  1&gt;  INI.cpp
  1&gt;c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
  </code></pre>
  
  <p>I am using VS2010 and need to build win32 console project. Please help.</p>