I am new to programming in general and especially to graphical programming, so expect newb answers (I am so sorry for my newbness)
basically the libraries aren't loaded. but /usr/bin/gtk-demo works perfectly and I couldn't find any packages with emerge that hadn't been installed.
here is the hello world code (from foundations in GTK+)
- Code: Select all
#include <gtk/gtk.h>
int main (int argc,
char *argv[])
{
GtkWidget *window;
/* Initialize GTK+ and all of its supporting libraries. */
gtk_init (&argc, &argv);
/* Create a new window, give it a title and display it to the user. */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Hello World");
gtk_widget_show (window);
/* Hand control over to the main loop. */
gtk_main ();
return 0;
}
and when I compile it
- Code: Select all
$ gcc -Wall -g helloworld.c `pkg-config --cflags gtk+-2.0` \`pkg-config --libs gtk+-2.0
gcc: `pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
cc1: error: unrecognized command line option "-flibs"

