Re: Can't get basic hello world app to compile... help?



Try looking at the output of pkg-config --cflags --libs gtk+-2.0 You
might be missing some dependencies like cairo, pango, etc. (although I
thought the package manager took care of that for you). If you also
want the gnome development libraries, try installing the
gnome-core-devel package.
Samuel Cormier-Iijima

On 11/25/06, Brian Dixon <briandixon glacierboats com> wrote:
Hi,

  I've got a relatively new installation of Ubuntu Dapper Drake on my
machine and have installed what I thought was a pretty complete set of
GTK installations, e.g. libgtk2.0-dev, the -engine stuff (a few of
them), the libgnome libs, etc.  When I try to compile the program below
(compilation command line shown in the comments), I get a complaint from
gcc that gtk/gtk.h can't be found (plus a bunch of compiler
misunderstandings on unresolved constants and functions etc).  When I
modify the program to include the whole path to the gtk.h file,
e.g. /usr/include/gtk-2.0/gtk/gtk.h , then I get about 4000 error
messages ...mostly about syntax errors.  Although I used the Synaptic
Package Manager to do the installations, I assume that my GTK+2
installation isn't right.  So here are my questions:

- I assume that there should be some environment variables set up so the
compiler/linker can find the includes and libraries?  What environment
settings should I be providing?
- Can someone tell me the minimum set of Ubuntu packages that *should*
be installed?  Assuming that I left something out?
- Is there some post-install step or steps that I should've accomplished
after the install of the libraries?  (I even tried putting a 'gtk'
symbolic link in /usr/include to point to the full directory but
no-worky ...same 4k errors)

  I saw some other bloke online with exactly the same problem, to a 'T',
and a bunch of guesses from people on what the solution might be but
none of them answered the question... help!  Any Ubuntu fans here?

Thanks,
Brian

// Here's the code
//
// gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`
//


#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;
}

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




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