You are not logged in.
Hello,
this is embarassing, but I get an error when I try to compile this code:
#include <gtk/gtk.h>
int main(int argc, char **argv)
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_widget_show(window);
return 0;
}
with command:
$ gcc hello_gtk.c -o hello_gtk 'pkg-config --cflags --libs gtk+-3.0'
and I get and error:
gcc: error: pkg-config --cflags --libs gtk-3.0: No such file or directory
My path to file "gtk.h" (quotes for clarity) is:
/usr/include/gtk+-3.0/gtk/gtk.h
Do you have an idea, what could the problem be?
Thanks,
-pizet
Last edited by pizet (2011-07-17 07:31:25)
Do you follow my way? Or just see a black stain swimming in the Milky Way...
Offline
You want either
gcc hello_gtk.c -o hello_gtk `pkg-config --cflags --libs gtk+-3.0`
or
gcc hello_gtk.c -o hello_gtk $(pkg-config --cflags --libs gtk+-3.0)
With simple quotes gcc thinks this is a file..
Edit: Also your program doesn't call the gtk_main().
Last edited by SahibBommelig (2011-07-16 21:43:53)
Offline
Oh my god, yes, I'm fool.
Do you follow my way? Or just see a black stain swimming in the Milky Way...
Offline