Garmekain
Garmekain

Reputation: 674

Segfault when calling gtk_drawing_area_new

I have just a simple program

#include <gtk/gtk.h>

int main() {
    GtkWidget * drawingarea = gtk_drawing_area_new(); // <-- Segfault
    return 0;
}

which just creates a drawing area. But it segfaults. Why? I'm using ubuntu 18.04.

Upvotes: 0

Views: 56

Answers (1)

Garmekain
Garmekain

Reputation: 674

Using gtk_init before the call to gtk_drawing_area_new solves this problem.

Upvotes: 1

Related Questions