Menu

installing and using GTK...confused ?!!?

dave_mich
2007-02-03
2012-09-26
  • dave_mich

    dave_mich - 2007-02-03

    Hi All,

    I am new to DEVCPP and GTK. I try to install GTK but it doesn't seem to allow me to compile and I am quite confused.
    I don't really understand the linker thing either ? can someone explain to me in detail how the whole thing work ?

    cheers guys

    Dave

     
    • Wayne Keen

      Wayne Keen - 2007-02-03

      In the thread titled "Please Read Before Posting a Question",
      the one that you posted directly over the top of, without
      reading - there is a section on the compile log, including
      headers, and linking libraries that will help you understand
      the mechanics of libraries and linking.

      If you are still having a problem, please post your Basic 3,
      they are covered in that same thread.

      Wayne

       
    • dave_mich

      dave_mich - 2007-02-03

      Alright thanks, it helped me to understand how the whole linking and headers stuff. however, I am still not quite crystal clear on it yet... For example, I am trying to run the "hello world" of GTK:

      include <gtk/gtk.h>

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

      gtk_init (&amp;argc, &amp;argv);
      
      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      gtk_widget_show  (window);
      
      gtk_main ();
      
      return 0;
      

      }

      So, for this I downloaded and install the GTK librairies (from http://gimp-win.sourceforge.net/stable.html)
      but I don't know if these are correct or not because the file gtk.h is actually located in C:\Dev-Cpp\include\gtk-2.0\gtk\

      Not suprisingly, the compilation does not work and give this:

      Compiler: Default compiler
      Executing gcc.exe...
      gcc.exe "C:\TEST\hello.c" -o "C:\TEST\hello.exe" -fexpensive-optimizations -O3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
      C:\TEST\hello.c:1:21: gtk/gtk.h: No such file or directory
      C:\TEST\hello.c: In function main': C:\TEST\hello.c:6: error:GtkWidget' undeclared (first use in this function)
      C:\TEST\hello.c:6: error: (Each undeclared identifier is reported only once
      C:\TEST\hello.c:6: error: for each function it appears in.)
      C:\TEST\hello.c:6: error: window' undeclared (first use in this function) C:\TEST\hello.c:10: error:GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)

      Execution terminated

      1. So maybe, I have installed the wrong package...?? if so, which one shall I put ?

      2. I have not put anything in the linker option because I don't know what to put. GTK needs other dependencies like pango, ATK..etc...which came with package dut I don't know how this is all linked together

      thanks for your help

      Dav

       

Log in to post a comment.