3
votes

I'm building an interface using glade and gtk programming on c using netbeans. I've set up my project following this tutorial. I even added libgmodule2-0.so and libglib2-0.so to the linker options of netbeans. When I run i get the warning Gtk-WARNING Could not find signal handle. When I close the mainwindow nothing happens (this is where my signal should be caught)

If I compile my program like this (not using netbeans)

gcc -o tut main.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) 

it works fine. When I close the mainwindow it closes.

I like using IDEs because all the features I get (specially debugging). Any suggestion for this problem?

1

1 Answers

2
votes

I think that adding libgmodule2-0.so and libglib2-0.so to the linker options is not enough. Run the command pkg-config --cflags gtk+-2.0 gmodule-2.0 in your terminal and see what it says. Add any directories listed with -I to the include directories of your NetBeans project, and add any other flags to the C compiler options.

Then run pkg-config --libs gtk+-2.0 gmodule-2.0 in your terminal and add anything listed there to the linker options.