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

alg*_*ior 5 macos

我正在尝试使用“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
Run Code Online (Sandbox Code Playgroud)

但是,我检查了一下,我的系统已经有了 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
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能让安装找到 ft2build.h 文件?

小智 5

brew install freetype --with-freetype-dir=/usr/local/Cellar/freetype
Run Code Online (Sandbox Code Playgroud)

  • “错误:无效选项:--with-freetype-dir=/usr/local/Cellar/freetype” (5认同)

cod*_*ody 0

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