Here is my code right now
#include <stdlib.h>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <math.h>
#include <time.h>
#include <ctype.h>
GtkWidget* window;
GtkWidget* fixed;
GtkWidget* menu;
GtkWidget* file;
GtkWidget* open;
GtkBuilder* builder;
int main(int argc, char* argv[]) {
gtk_init(&argc, &argv);
builder = gtk_builder_new_from_file("gui.glade");
window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_builder_connect_signals(builder, NULL);
fixed = GTK_WIDGET(gtk_builder_get_object(builder, "fixed"));
menu = GTK_WIDGET(gtk_builder_get_object(builder, "menu"));
file = GTK_WIDGET(gtk_builder_get_object(builder, "file"));
open = GTK_WIDGET(gtk_builder_get_object(builder, "open"));
gtk_widget_show(window);
gtk_main();
return EXIT_SUCCESS;
}
If I remove the initialization for the widget open and the statement where I pull it out from builder, the program executes fine but with it in there I get the Segmentation fault. I tried stepping through it with gdb, but it hasn't helped.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…