3

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?

Lorraine
  • 1,189
  • 14
  • 30
gvalero87
  • 855
  • 3
  • 15
  • 32

1 Answers1

2

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.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • that worked. I was following a tutorial how to set up netbeans with gtk and they didn't added all libs and includes pkg-config showed. Thx – gvalero87 Aug 19 '10 at 21:50
  • 2
    For the record adding "gmodule-2.0", took care of the whines for clang and gtk+3.0, thanks! My usage: `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0 gmodule-2.0` – cdated Jun 12 '12 at 04:36