title: Cannot convert 'wchar_t' to 'LPCSTR'
body: <p>I'm using Atom as my Editor and I have the g++ compiler to compile my C++ file.</p>
  
  <p>The Code snippet in question is:</p>
  
  <pre><code>bool openComPort(wchar_t* portSpecifier)
  {
      DCB dcb;
  
      // Open Serial Port
      wprintf(L"Opening COM PORT: %s",portSpecifier);
      printf("\n");
  
      serialPort = CreateFile(portSpecifier,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
  
      if (serialPort == INVALID_HANDLE_VALUE)
      {
          wprintf(L"Error opening Serial port: %s\n",portSpecifier);
          return(false);
      }
  
      ...
  
      return true;
  }
  
  </code></pre>
  
  <p>And if I want to Compile it, I always get the Error: </p>
  
  <blockquote>
    <p>error: cannot convert 'wchar_t' to 'LPCSTR' {aka 'const char'} serialPort = CreateFile(portSpecifier,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);</p>
  </blockquote>
  
  <p>I've read it should have something to do with Windows and UNICODE or ASCII. </p>
  
  <p>I made sure Atom uses UNICODE by pressing ctrl+shift+U and selecting UTF-8.</p>
  
  <p>I tried to <code>#define UNICODE</code> in the beginning. Didn't work.</p>
  
  <p>I've tried different solutions from other threads like: </p>
  
  <pre><code>(_TCHAR*)wprintf(L"Opening COM PORT: %s",portSpecifier);
  </code></pre>
  
  <p>Still i always get the same error. Do you have any suggestion on how to fix this?</p>