title: "Gtk-WARNING **: cannot open display: " when using execve to launch a Gtk program on ubuntu
body: <p>I have the following c program which launches a Gtk Program on ubuntu:</p>
  
  <pre><code>#include &lt;unistd.h&gt;
  
  int main( int argc, const char* argv[] )
  {
      char *args[2] = { "testarg", 0 };
      char *envp[1] = { 0 };
      execve("/home/michael/MyGtkApp",args,envp);
  }
  </code></pre>
  
  <p>I get "<code>Gtk-WARNING **: cannot open display:</code> " and my program is not launched.</p>
  
  <p>I have tried setting <code>char *envp[1] = {"DISPLAY:0.0"};</code> and execute '<code>xhost +</code>' , I don't see the 'cannot open display' warning, but my program is still not launched.</p>
  
  <p>Does anyone know how to fix my problem?</p>
  
  <p>Thank you.</p>