Using gcc instead of clang in ghci or ghc

前端 未结 1 1729
借酒劲吻你
借酒劲吻你 2020-12-31 20:23

On Mac OSX 10.9, the default c compiler bundled with Xcode is clang. I installed gcc-4.9 with homebrew. Now I have two di

1条回答
  •  遥遥无期
    2020-12-31 21:00

    Reproducing my directions I've been sharing with haskellers for the past few months via https://gist.github.com/cartazio/7131371

    1. Type ghc --print-libdir

      The output will be a path like /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3

    2. Go to that directory and edit the settings file.

    3. There'll be a line indicating the path to the C compiler. It'll probably say /bin/gcc

    4. Change that line to /usr/local/bin/gcc-4.8 (or whichever gcc version you brew installed, such as /usr/local/bin/gcc-4.2)

    0 讨论(0)
提交回复
热议问题