title: Using mciSendString in Qt project
body: <p>I’m trying to use the mciSendString function to open and close the cd tray in Qt. Here is the code:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  MCIERROR mciSendString(LPCTSTR lpszCommand, LPTSTR lpszReturnString, UINT cchReturn, HANDLE hwndCallback);
  void OpenCD()
  {
      mciSendString((LPCTSTR)"set cdaudio door open",(LPTSTR)NULL, (UINT)0, (HANDLE)NULL);
  }
  void CloseCD()
  {
      mciSendString((LPCTSTR)"set cdaudio door closed",(LPTSTR)NULL, (UINT)0, (HANDLE)NULL);
  }    
  </code></pre>
  
  <p>But I get this error: “ undefined reference to `mciSendStringW(wchar_t const*, wchar_t*, unsigned int, void*)' ”
  How can I fix this error and use the mciSendString function without any problem?</p>