dimanche 3 juillet 2016

Why Is my compiler giving me these errors after I've downloaded GTK?

I'm new to the GTK library and there's a problem with compilation when running the funning program:

#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{
    GtkWidget *window;

    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);

    gtk_main ();

    return 0;
}

I typed this in when compiling:

gcc practice.c -o practice `pkg-config --cflags --libs gtk+-2.0`

and got the following errors:

gcc: error: `pkg-config: No such file or d
gcc: error: gtk+-2.0`: No such file or dir
gcc: error: unrecognized option '--cflags'
gcc: error: unrecognized option '--libs'

I'm not sure why this won't compile, because I downloaded GTK+ 2.24.10 the official site and I even stored it in it's own file and created a path for it in the environmental variables ;C:GTK STUFF

So what am I doing wrong because when I fist downloaded the MinGW and added the c compiler to my path, it worked like a charm, so what's the problem now? Am I supposed to download something extra or do I store it elsewhere. I've tried storing it in the C binary file, but got the same outcome and the official site only gives you the files to download, and not anything else specific i compiling- other than the commands to compile at the cmd.

Aucun commentaire:

Enregistrer un commentaire