OSX 10.7.5:致命错误:找不到“ft2build.h”文件

2024-06-02 01:08:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图使用“make”命令安装一个名为“ROOT”(http://root.cern.ch/drupal/content/installing-root-source)的程序,但出现以下错误:

clang++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude -pthread -I/Users/builder/pisi-64bit/tmp/freetype-2.4.4-1/install/include/freetype2 -I/Users/builder/pisi-64bit/tmp/freetype-2.4.4-1/install/include -o graf2d/graf/src/TMathText.o -c /Users/alex/root/graf2d/graf/src/TMathText.cxx
    /Users/alex/root/graf2d/graf/src/TMathText.cxx:15:12: fatal error:
    'ft2build.h' file not found

但是,我检查了一下,我的系统已经有了ft2build.h:

    locate ft2build.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11/include/ft2build.h
    /opt/X11/include/ft2build.h
    /opt/local/include/ft2build.h
    /usr/X11/include/ft2build.h

如何才能使安装程序找到ft2build.h文件?


Tags: installsrcincludebuilderrootuserstmpfreetype
3条回答

使用-I参数将头的路径添加到clang include路径: clang++ ... -I/opt/local/include ...例如。
接下来您可能会得到链接错误-使用-L参数。

所以我最近在尝试在我的工作版本的根上配置PyROOT时发现了这个问题。如果仔细观察./configure。。。输出您将找到一个自由式配置和找到它的目录。我的问题是这个目录是我的Python包的目录,它没有ft2build.h文件以及根目录所需的其他文件。

在查看了根配置文件之后,我看到了一个选项,可以强制make在标准位置(对我来说是/opt/local/include)中查找。以下对我有效:

./configure macosx64--enable python--with python incdir=$PYTHONDIR/include--with python libdir=$PYTHONDIR/lib--enable builtin freetype

我试过使用上面提到的-I技术,但是对于大量的文件,您必须这样做(ft2build.h是ROOT无法找到的许多文件中的第一个)

如果这不是您的问题,您显然可以忽略python的内容,但最后一个选项是key(我为您添加了粗体)。

希望能有帮助!

brew install freetype --with-freetype-dir=/usr/local/Cellar/freetype

相关问题 更多 >