title: C++ Sys/Stat.h has an error?
body: <p>I'm trying to create a cross-platform program. I just created a class and made a function which gets the path of the current user. I wanted to use that path later. But somehow I get these errors :</p>
  
  <p>"/usr/include/x86_64-linux-gnu/sys/stat.h:-1: In member function 'void FileManager::p_getfilepath()':"</p>
  
  <p>"/usr/include/x86_64-linux-gnu/sys/stat.h:105: error: expected unqualified-id before string constant"</p>
  
  <p>"/home/david/VocabularyTrainer/filemanager.cpp:31: error: expected '}' at end of input"</p>
  
  <p>btw the 31th line is the last line here in this code :</p>
  
  <pre><code>void FileManager::p_getfilepath()
  {
  #ifdef Q_OS_WIN32
  #include &lt;windows.h&gt;
  #endif
  
  #ifdef Q_OS_LINUX
  #include &lt;sys/stat.h&gt;
  
  struct passwd *p;
  uid_t  uid;
  
  if ((p = getpwuid(uid = geteuid())) == NULL)
  {
      QMessageBox* mb;
      mb-&gt;setText("");
      mb-&gt;exec();
      delete mb;
  }
  else
  {
      filepath = p-&gt;pw_dir;
  }
  #endif
  }
  </code></pre>
  
  <p>Anyone knows what's wrong? I'm on linux mint.</p>