|
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
main()
{
pid_t pid;
if ((pid=fork())<0)
printf ("fork error");
else if (pid ==0){
if (execv ("/home/josfar/base",NULL)<0)
printf ("execv error");
}
if (waitpid (pid,NULL,0)<0)
printf ("waitpid error");
exit (0);
}
其中base是用gtk+编的程序,有图形界面。把上面这段程序编译运行了之后却没有任何反应,base并没有运行,请问这是为什么?谢谢。 |
|