RE: GTK+ and MinGw..............



Hi,

Thanx for your comments. I found that pkg-config does the trick. But when iam running pkg-config on its own in command prompt (c:\pkg-config gtk+-2.0 -libs -cflags), it return a bulk of include files along with their path.

    When i tried the same thing using gcc
( gcc -c hello.c `pkg-config gtk+-2.0 -libs -cflags`), i got the error message such that "pkg-config: No such file or directory".

Finally i passed all include files along with their path as arguments to gcc by hand.

   Compilation
  -------------
c:> gcc -c hello.c -Ic:/gtk/include/gtk-2.0 -Ic:/gtk/lib/gtk-2.0/include -Ic:/gtk/include/atk-1.0 -Ic:/gtk/include/pango-1.0 -Ic:/gtk/include/glib-2.0 -Ic:/gtk/lib/glib-2.0/include

    Linking
    -------
c:> gcc -o hello hello.o -Lc:/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv

After linking, I got hello.exe. When executed hello.exe, I got an error message stating that "The procedure entry point g_get_application_name could not be located in the dynamic link library libglib-2.0-0.dll". I set "c:\gtk\lib" to PATH variable which contains all library files.

Now, How can i use pkg-config in gcc so that all needed include files will be taken from pkg-config's output?

    How to rectify the above error (libglib-2.0-0.dll) ?

  Thanx.




On Tue, 16 Sep 2003 Tor Lillqvist wrote :
Suresh Kumar writes:

> I set the "include" path in the PATH variable as follows:

> Path = c:\MinGw\bin;c:\gtk2dev\bin;c:\gtk2dev\program files\common files\gtk\2.0\lib;c:\gtk2dev\program files\common files\gtk\2.0\bin;c:\gtk2dev\include

Egads. Why do you add the *include* directories to your *PATH*? PATH
is the list of folders from where Windows looks for executable
programs and DLLs. It has nothing to do with looking for header files.

You should pass the folders from which to look for header files to the compiler using -I switches. Try reading the documentation for gcc (or
any other Unix-style command-line C compiler).

This is really very very basic gcc usage knowledge.

> Still i got the same error. (gtk\gtk.h: No such file or
> directory)

Does the message really use a backslash? Do you use a backslash in the #include line in your sources? Don't. Use gtk/gtk.h. It will work as well, and make your program portable to Unix, too. (I hope portability
is one of the reason you chose GTK+ in the first place?)

--tml
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___________________________________________________
Catering meets Camera; Tanya Weds Sahil.
Rediff Matchmaker strikes another interesting match
Visit http://matchmaker.rediff.com?1




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]