Find the answer to your Linux question:
Results 1 to 5 of 5
I have issues trying to compile my own gtk-based programs, I get a ton of errors, the errors are related to missing header files. The header files do exist but ...
  1. #1
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    104

    Unable to compile gtk programs ...

    I have issues trying to compile my own gtk-based programs, I get a ton of errors, the errors are related to missing header files. The header files do exist but are in the incorrect location.
    I have attempted to edit the source files, but the problem only turns worse.
    I have attempted to apt-get remove and then apt-get install the libraries again, to no avail.

    Debian 4.0 on an x86.

    In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
    from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
    from /usr/include/gtk-2.0/gdk/gdk.h:30,
    from /usr/include/gtk-2.0/gtk/gtk.h:31,
    from text_editable_window.c:1:
    /usr/include/gtk-2.0/gdk/gdktypes.h:32:18: error: glib.h: No such file or directory
    In file included from /usr/local/include/pango-1.0/pango/pango-font.h:25,
    from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
    from /usr/local/include/pango-1.0/pango/pango.h:25,
    from /usr/include/gtk-2.0/gdk/gdktypes.h:33,
    from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
    from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
    from /usr/include/gtk-2.0/gdk/gdk.h:30,
    from /usr/include/gtk-2.0/gtk/gtk.h:31,
    from text_editable_window.c:1:

    I have the header files in question, so I included them with -I arguments to gcc:

    -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

    That made all my errors go away except:

    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libgtk-x11-2.0.so: undefined reference to `atk_relation_add_target'
    collect2: ld returned 1 exit status

    How can I correct that?
    And how can I permanently add those directories I added with -I to the path that will always be searched for header files?

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    How can I correct that?
    And how can I permanently add those directories I added with -I to the path that will always be searched for header files?

    try editing your /etc/ld.so.cache file

    or using the ldconfig utility to edit the above file

  3. #3
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    104
    Quote Originally Posted by gerard4143 View Post
    How can I correct that?
    And how can I permanently add those directories I added with -I to the path that will always be searched for header files?

    try editing your /etc/ld.so.cache file

    or using the ldconfig utility to edit the above file
    This did nothing at all for me, I added the topical directories to my ld.so.cache to no avail.

    Even so, the main issue is to get gtk programs to compile at all.

  4. #4
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    how are compiling? are you using something similiar to this?

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

    note ` is a back tick not a single quote

  5. #5
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    104
    Quote Originally Posted by gerard4143 View Post
    how are compiling? are you using something similiar to this?

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

    note ` is a back tick not a single quote
    Yes, I'm using exactly that. I've been compiling quite a few gtk programs in the past, and I'm perfectly able to compile gtk programs on my other computers (which run Slackware).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...