Problem with helloworld in gtk+

Discussion in 'Linux' started by George Shering, Nov 22, 2008.

  1. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    I just bought the book "Foundations of GTK+ Development" by Andrew Krause but am stuck at the first example!

    [user@localhost gtkbook]$ gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0` \ `pkg-config --libs gtk+-2.0`
    gives
    gcc: -lgtk-x11-2.0: No such file or directory
    The example /usr/bin/gtk-demo works, built in by Acer I think.
    The command [user@localhost gtkbook]$ gcc -c -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0`
    gives
    [user@localhost gtkbook]$
    so works and gives the helloworld.o file OK so it must be the linker?
    I have installed using add/remove programs the likely looking gtk things.
    I have these in my /usr/lib directory:
    libgtk-x11-2.0.so
    libgtk-x11-2.0.so.0
    libgtk-x11-2.0.so.0.1200.8
    Please, what is wrong or missing?
     
    George Shering, Nov 22, 2008
    #1
  2. George Shering

    George Shering

    Joined:
    Nov 5, 2008
    Messages:
    24
    Likes Received:
    0
    Sorry to have bothered you. After hours of searching through linker options, .so files, etc, I found the problem is the "\" in the command line. Without it the gcc does the job. It is in the book !!!!! why I don't know?
    George.
     
    George Shering, Nov 22, 2008
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.