fork问题

我想做的是 在程序中开一个终端,并执行写好的另一个程序。
(1)用execlp("gnome-terminal","gnome-terminal","-x","/home/bear/Desktop/rubbish/s", NULL);
运行时提示
Failed to connect to the session manager: None of the authentication protocols specified are supported。
(2)然后改用system("sudo gnome-terminal /home/bear/Desktop/rubbish/s");
可以打开终端,但是不能执行编译好的程序。
这两个函数怎么改才能达到我的目的呢?求教!

作者: bearsiji   发布时间: 2011-05-19