V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
icexfire
V2EX  ›  问与答

GCC could not be found... os x 小白求助

  •  
  •   icexfire · 2012-04-04 13:26:04 +08:00 · 4345 次点击
    这是一个创建于 4614 天前的主题,其中的信息可能已经有所发展或是发生改变。
    打算安装fontforge,然后直接
    brew install fontforge的话,会在make这一步
    Error: Failed executing: make (fontforge.rb:38)
    brew install fontforge --use-clang 也会出现同样的错误。

    google下,有人用:
    brew install fontforge --use-gcc
    但是我这里出现:
    Error: GCC could not be found

    但是
    gcc --version
    i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 明明安装了啊。。。

    xcode和command line tools for xcode也安装了的 cairo也安装了

    小白求助 >_<
    9 条回复    1970-01-01 08:00:00 +08:00
    icexfire
        1
    icexfire  
    OP
       2012-04-04 18:25:37 +08:00
    eric_q
        2
    eric_q  
       2012-04-04 19:44:14 +08:00
    $PATH问题?
    icexfire
        3
    icexfire  
    OP
       2012-04-04 20:37:10 +08:00
    @eric_q 刚刚又执行了一下 brew update 和 brew upgrade 这次执行的时候貌似更新了点东西。

    现在不会有Error: GCC could not be found错误了,全部都是 Error: Failed executing: make (fontforge.rb:38)了,无论 --use-clang 还是 --use-gcc

    彻底无语了,网上很多人都是 --use-gcc 成功安装的。

    附上fontforge.rb文件


    1 require 'formula'
    2
    3 class Fontforge < Formula
    4 url 'http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full- 20110222.tar.bz2'
    5 head 'git://fontforge.git.sourceforge.net/gitroot/fontforge/fontforge'
    6 homepage 'http://fontforge.sourceforge.net'
    7 md5 '5be4dda345b5d73a27cc399df96e463a'
    8
    9 depends_on 'pkg-config' => :build
    10 depends_on 'gettext'
    11 depends_on 'pango'
    12 depends_on 'potrace'
    13
    14 def options
    15 [['--without-python', 'Build without Python.']]
    16 end
    17
    18 fails_with :llvm do
    19 build 2336
    20 cause "Compiling cvexportdlg.c fails with error: initializer element is not constant"
    21 end
    22
    23 def install
    24 args = ["--prefix=#{prefix}", "--enable-double", "--without-freetype-bytecode"]
    25 args << "--without-python" if ARGV.include? "--without-python"
    26
    27 ENV.x11
    28 # Fix linker error; see: http://trac.macports.org/ticket/25012
    29 ENV.append "LDFLAGS", "-lintl"
    30 system "./configure", *args
    31
    32 # Fix hard-coded install locations that don't respect the target bindir
    33 inreplace "Makefile" do |s|
    34 s.gsub! "/Applications", "$(prefix)"
    35 s.gsub! "ln -s /usr/local/bin/fontforge", "ln -s $(bindir)/fontforge"
    36 end
    37
    38 system "make"
    39 system "make install"
    40 end
    41
    42 def caveats; <<-EOS.undent
    43 fontforge is an X11 application.
    44
    45 To install the Mac OS X wrapper application run:
    46 brew linkapps
    47 or:
    48 ln -s #{prefix}/FontForge.app /Applications
    49 EOS
    50 end
    51 end
    roamlog
        4
    roamlog  
       2012-04-04 20:38:39 +08:00
    icexfire
        5
    icexfire  
    OP
       2012-04-04 20:41:07 +08:00
    @roamlog 现在的没有“GCC could not be found.”这个提示了
    只有在执行到 38行 system "make" 然后出错,这个和osx-gcc有关么?
    MartianZ
        6
    MartianZ  
       2012-04-04 22:55:49 +08:00 via iPod
    安装xcode和command line tools
    MartianZ
        7
    MartianZ  
       2012-04-04 22:56:41 +08:00 via iPod
    好吧。。你已经安装gcc了。。无视我上面的回复吧 抱歉
    rikugun
        8
    rikugun  
       2012-04-04 23:04:56 +08:00
    你试试

    brew missing

    brew doctor

    看看
    icexfire
        9
    icexfire  
    OP
       2012-04-04 23:15:06 +08:00
    @MartianZ 嗯,已经安装xcode和CLT了

    @rikugun brew missing 执行后没有任何反映,
    brew doctor 只有一个 Warning:

    Warning: "config" scripts exist outside your system or Homebrew directories.
    `./configure` scripts often look for *-config scripts to determine if
    software packages are installed, and what additional flags to use when
    compiling and linking.

    Having additional scripts in your path can confuse software installed via
    Homebrew if the config script overrides a system or Homebrew provided
    script of the same name. We found the following "config" scripts:

    /Users/iceX/.rvm/gems/ruby-1.9.3-p125/bin/passenger-config

    这个貌似是之前瞎玩的时候安装的,然后一直这样。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   956 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:25 · PVG 05:25 · LAX 13:25 · JFK 16:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.