这就是我构建它的方式:gcc pkg-config --cflags --libs gtk+-2.0
-o spawn spawn_with_pipes.c
在下面的示例片段中,我收到一个错误:“数据之前的语法错误 - 它指的是 data= g_slice_new(Data);
#include <gtk/gtk.h>
typedef struct
{
/* Buffers that will display output */
GtkTextBuffer *out;
GtkTextBuffer *err;
/* Progress bar that will be updated */
GtkProgressBar *progress;
/* Timeout source id */
gint timeout_id;
}Data;
data= g_slice_new(Data); //error here