在Mac OS X 10.8(Mountain Lion)上建立graphviz时找不到Xlib.h [英] Xlib.h not found when building graphviz on Mac OS X 10.8 (Mountain Lion)

查看:131
本文介绍了在Mac OS X 10.8(Mountain Lion)上建立graphviz时找不到Xlib.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用自制程序安装graphviz时,脚本到达在tkstubs中进行安装"的位置,然后引发以下致命错误:

When using homebrew to install graphviz, the script gets to the point of "Making install in tkstubs" and then throws the following fatal error:

In file included from tkStubLib.c:15:
/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>

我已经安装了XQuartz,因为Mountain Lion中已经放了X11,但是我不确定它是否安装正确. Xlib.h的位置是:

I have installed XQuartz as X11 has been dropped in Mountain Lion, but I'm unsure if it is installed correctly. The location of Xlib.h is:

/opt/X11/include/X11/Xlib.h

/opt/X11还有两个符号链接,它们是:

There are also two symlinks to /opt/X11, they are:

/usr/X11
/usr/X11R6

对您来说,这看起来像是正确的设置吗?直到昨天,我才开始使用X11或XQuartz.

Does this look like the correct setup to you? I've never dealt with X11 or XQuartz until yesterday.

干杯.

推荐答案

您需要告诉tkstubs构建(以及包中可能还有其他位)来查找/opt/X11/include中的标头.这不是标准的包含路径.

You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include; this is not on the standard include path.

通常,这是通过传递-I/opt/X11/include作为附加的编译器标志来实现的,但是此方法取决于构建系统.

Usually this is achieved by passing -I/opt/X11/include as an additional compiler flag, the method to do so is however dependent on the build system.

对于相当现代的configure脚本,最好的方法是将其传递到环境变量CPPFLAGS中.如果软件包使用其他构建系统,或者由于其他原因而无法使用,则需要查看构建目录中的Makefile.

For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS; if the package uses another build system or this doesn't work for another reason, then you need to look at the Makefile in the build directory.

这篇关于在Mac OS X 10.8(Mountain Lion)上建立graphviz时找不到Xlib.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆