在 Mac OS 10.6.3 上安装 PyGTK 依赖项时出错

发布于 2024-09-01 21:07:09 字数 740 浏览 3 评论 0原文

我尝试在 Mac OS 10.6.3 上安装 PyGTK 2.16.0(Python GIMP 工具包)的以下依赖项:

  • glib 2.25.5
  • gettext-0.18
  • libiconv-1.13.1

当我尝试安装 glib 时,出现以下错误消息:

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

libiconv 网页讨论了 gettext 和 libiconv 之间的循环依赖关系---build一个,然后构建另一个,然后再次构建第一个。我尝试这样做,尽管可能是错误的。 (以下内容是否有效:make distclean; ./configure; make; sudo make install?)

发帖也有同样的问题,他通过安装libiconv-1.13.1解决了这个问题。

谁能更详细地解释该错误以及如何纠正它?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

夏有森光若流苏 2024-09-08 21:07:09

虽然这是一个老问题,但仍然想分享对我有用的解决方案。

导航到“glib”文件夹(只是简单的 glib,主 glib 源文件夹内的一个),然后使用您最喜欢的编辑器打开“gconvert.c”。

#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

替换最后 3 行,如下所示:

#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

来源:
http://letsneverdie.net/blog/?p=75

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

别想她 2024-09-08 21:07:09

出现错误消息的原因是,如果您针对 OS X 上当前(~10.6.3)系统安装的 libiconv 版本构建 glib,则需要将 --with-libiconv=gnu 传递给 glib 配置脚本。然而,默认情况下 GTK-OSX 构建脚本不会传递此信息。

简单的解决方案是下载最新的 libiconv (http://www.gnu.org/software/ libiconv/#downloading),并将 GTK 安装的位置作为安装前缀进行配置,例如:

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

使用此版本的 libiconv,似乎您不需要 pas --with-libiconv=gnu 来glib 配置,因此您现在可以通过重新运行 glib 配置阶段来继续 GTK-OSX 构建过程。

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.

弥繁 2024-09-08 21:07:09

由于我看到许多关于 MacPorts 包管理器不如 Fink 包管理器可靠的报告,我建议安装Fink,然后简单地做

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

最重要的是,Fink 可以让您访问比 MacPorts 更多的软件包。

我认为,如果您计划使用开源程序,那么“投资”包管理器是必须的。

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.

梦里泪两行 2024-09-08 21:07:09

在 Mac 上,如果您想安装 GTK+、PyGTK 或某些其他程序,可以下载 MacPorts

在终端中,输入 port search gtk 以搜索与 GTK+ 相关的程序。您将需要互联网连接。

输入 sudo port install gtk2 来安装 GTK+2。 MacPorts 将查找并安装任何依赖项。

输入 portinstalled 以查看您使用 MacPorts 安装的程序。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文