0

I tried to install the following dependencies for PyGTK 2.16.0 (the Python GIMP Tool Kit) on Mac OS 10.6.3:

  • glib 2.25.5
  • gettext-0.18
  • libiconv-1.13.1

When I tried to install glib, I got the following error message:

gconvert.c:55:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv

The libiconv web page talks about a circular dependency between gettext and libiconv---build one, then build the other, then build the first again. I tried to do this, though possibly incorrectly. (Will the following work: make distclean; ./configure; make; sudo make install?)

The author of a posting had the same problem, and he solved it by installing libiconv-1.13.1.

Could anyone explain the error in more detail, and how to correct it?

Winston C. Yang
  • 1,497
  • 2
  • 18
  • 27

4 Answers4

2

Though it is an old question, still want to share the solution that worked for me.

Navigate to the ‘glib’ folder (just plain glib, the one INSIDE of the main glib source folder), and open ‘gconvert.c’ with your favorite editor.

#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
#error GNU libiconv in use but included iconv.h not from libiconv
#endif

#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)
#error GNU libiconv not in use but included iconv.h is from libiconv
#endif

replace the last 3 lines, like so:

#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
#error GNU libiconv in use but included iconv.h not from libiconv
#endif

#if !(defined(__APPLE__) && defined(__LP64__)) && !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)
#error GNU libiconv not in use but included iconv.h is from libiconv
#endif

Source: http://letsneverdie.net/blog/?p=75

0

The reason for the error message is that if you build glib against the current (~10.6.3) system installed version of libiconv on OS X, you need to pass --with-libiconv=gnu to the glib configure script. However this isn't passed by default by the GTK-OSX build scripts.

The easy solution is to download the latest libiconv (http://www.gnu.org/software/libiconv/#downloading), and pass the location of your GTK install as the install prefix to configure e.g.:

$ cd libiconv-1.13.1/
$ ./configure --prefix=/Users/jamie/gtk/inst/
$ make && make install

With this version of libiconv, it seems that you don't need to pas --with-libiconv=gnu to glib configure, so you can now continue with the GTK-OSX build process by re-running the glib configure stage.

j b
  • 5,147
  • 5
  • 41
  • 60
0

Since I have seen many reports of the MacPorts package manager being less reliable than the Fink package manager, I would suggest installing Fink, and then simply doing

fink list pygtk  # Lists all pygtk packages
fink install pygtk2-gtk-py27  # This one, or the one that corresponds to your (Fink) Python

On top of that, Fink gives you access to more packages than MacPorts.

I consider that "investing" in a package manager is a must, if you plan to use open-source programs.

Eric O. Lebigot
  • 91,433
  • 48
  • 218
  • 260
-1

On a Mac, if you want to install GTK+, PyGTK, or certain other programs, you can download MacPorts.

In a terminal, type port search gtk to search for programs related to GTK+. You will need an internet connection.

Type sudo port install gtk2 to install GTK+2. MacPorts will find and install any dependencies.

Type port installed to see the programs that you have installed using MacPorts.

Winston C. Yang
  • 1,497
  • 2
  • 18
  • 27