[QCLUG] Problems Installing Software
Mark Riedesel
mriedesel@gmail.com
Fri, 4 Apr 2008 18:24:21 -0500
Always avoid installing things from source tarballs (the tar.gz
things) if pre-packaged binaries are available. In the case of Ubuntu
packages, we would be referring to .deb files, such as those available
through apt-get. Installing from tarballs is always an option,
although it typically requires knowledge about library dependencies
and being able to interpret lengthy compiler errors, you also lose the
benefit of automatic updates and dependency tracking that regular
package management systems provide.
Some pointers for diagnosing compilation issues would be to scroll up
to the point during the compile where it appeared to be doing things
successfully, and then determine where the first error appeared and
work your way down from there.
For the heck of it, I attempted compiling Roadmap, I currently don't
have the GTK2 development libraries installed so it was guaranteed to
fail at some point. It was progressing nicely and then exploded with
50 lines of generally cryptic errors like these...
roadmap_main.c: In function 'roadmap_main_remove_periodic':
roadmap_main.c:610: error: 'struct roadmap_main_timer' has no member
named 'callback'
roadmap_main.c:612: error: 'struct roadmap_main_timer' has no member
named 'callback'
roadmap_main.c:613: warning: implicit declaration of function
'gtk_timeout_remove'
roadmap_main.c:613: error: 'struct roadmap_main_timer' has no member named 'id'
So, I scroll upwards to where things were still looking good, lines like these..
gcc -O2 -ffast-math -fomit-frame-pointer -W -Wall
-Wno-unused-parameter -Wcast-align -Wreturn-type -Wsign-compare
-DROADMAP_USES_EXPAT -I. -I/usr/local/include -DNDEBUG -c -o
buildmap_messages.o buildmap_messages.c
Inbetween those sections I find this useful tidbit..
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
roadmap_main.c:33:21: error: gtk/gtk.h: No such file or directory
roadmap_main.c:34:28: error: gdk/gdkkeysyms.h: No such file or directory
>From that error combined with prior knowledge of what provides the
gtk.h header files, I can deduce that I am in fact missing the GTK
development libraries. Also the pkg-config error suggests it's GTK 2.0
specifically.
Now I quick search for packages that might satisfy that dependency.
Thankfully all the library packages begin with "lib", and development
libraries end with "-dev". Since we're compiling, we need the
development packages for that library.
So we'll search for libgtk2, and the package name will probably end
with -dev. The search can be performed like so ( piping the output to
'less' is optional of course, but helpful if you end up with a long
list of results )
apt-cache search libgtk2.*dev | less
( note: apt-cache uses regular expressions for pattern matching,
therefore .* is used as a wildcard rather than the regular glob-style
*, that's a whole other subject in itself though, to be more proper I
suppose it'd be ^libgtk2.*dev$, but that's just being nitpicky and now
I'm off-subject. Ignore everything I said inside these parenthesis! )
I get quite a few matches. I see libgtk1.2-dev, libgtk-vnc-1.0-dev,
libgtkmm-2.4-dev... keep looking, eventually I find libgtk2.0-dev!
Install it with sudo apt-get install libgtk2.0-dev. Attempt compiling
the application once again. If you get more errors, just repeat the
entire library hunting steps, wash, rinse, repeat, etc. On occasion
you'll run into compilation errors that aren't necessarily library
based, then you're pretty much screwed unless you start tinkering with
the sources.
So, the moral of the story is, pre-packaged binaries are our friend!
-Mark
-- snipsnip --
> > Have fun, BTW I don;t see a binary package for roadmap for ubutu.
> >
> I guess I don't understand. Do you mean that I can only install it if there
> is a "Ubuntu" binary package? I thought that any Linux package would work.
> Again, got a lot of learning to do.