0

I am trying to compile file-roller from git, but running autogen.sh gives me this error

configure: error: Package requirements (gtk+-3.0 >= 2.91.1) were not met:

No package 'gtk+-3.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I am running Ubuntu Maverick and don't wish to completely replace my current version of gtk, glib, etc.

I have tried to compile GTK using the --prefix argument of autogen.sh, but this gives me a similar error about my version of glib.

How can I successfully compile file-roller using these new libraries without borking my install?

  • I have used the --prefix argument of autogen.sh to install glib under ~/glib, but I don't know how to compile gtk using this directory, and I assume that glib is not the only library that gtk will need a newer version of – William Friesen Nov 23 '10 at 15:30
  • At least nowadays, the `HACKING` doc in the root of the repo very clearly states that to build the `git` version of `gtk+`, you must first build the `git` versions of `glib`, `pango`, and `atk`. – underscore_d May 31 '16 at 20:43

1 Answers1

0

You have generally two options:

  • Tell each new software package that needs gtk, at configure time, where to look for the right libraries, or

  • Install new GTK side-by-side in a system location that is in the LD_LIBRARY_PATH.

The first option is simple and safe if you want to build (including compilation) just a few programs that depend on the new Gtk. There are different ways of pointing a software at a specific library location, depending on the configuration tool it uses. For classic applications with configure script, you'd need to have a look at configure phase options using ./configure --help. Look for things like --gtk-lib=PATH or --with-gtk-path=PATH. The --with part (common to many options) will usually be mentioned only once at the beginning of the help.

However, the File-roller you mention seems to be using autogen program for automated configuration procedure. The snippet you pasted indicates, what environment variables you need to set in order to point at a specific GTK+ path. It looks like running GTK_LIBS=/full/path/to/your/custom/lib ./autogen.sh should be enough.

A system-wide scenario is a bit more tricky, because each Linux distribution can manage the library paths in a bit different way, so I can't give you a universal solution.

jankes
  • 556
  • 2
  • 9