OS X 10.9.2: checking whether the C compiler works… no

前端 未结 8 571
耶瑟儿~
耶瑟儿~ 2020-12-09 02:41

I\'m attempting to install texinfo 5.2, and I\'m running into some issues during ./configure, which I believe are related to the C compiler. When I upgraded fr

相关标签:
8条回答
  • 2020-12-09 02:56

    I faced this same problem after installing xcode; All I had to do was run gcc. This then asked me to accept the xcode license. After, it just worked fine.

    Hope this helps someone.

    0 讨论(0)
  • 2020-12-09 02:57

    I had similar "checking whether the C compiler works... no" problem in my yosemite mac.

    I checked some things:

    $ which gcc
    gcc: aliased to nocorrect gcc
    $ ll /usr/bin/gcc
    -rwxr-xr-x  1 root  wheel    14K 27 Sep 04:06 /usr/bin/gcc
    $ gcc
    gcc: fatal error: no input files
    compilation terminated.
    $ gcc --version
    gcc: warning: couldn't understand kern.osversion '14.0.0
    gcc (GCC) 4.8.3
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    Then I installed it doing:

    $ brew install gcc
    Error: You must `brew link cloog' before gcc can be installed
    $ brew link cloog
    Linking /usr/local/Cellar/cloog/0.18.1... 8 symlinks created
    $ brew install gcc
    Error: gcc-4.8.3 already installed
    To install this version, first `brew unlink gcc'
    $ brew unlink gcc
    Unlinking /usr/local/Cellar/gcc/4.8.3... 39 symlinks removed
    $ brew install gcc
    ....
    

    And it worked:

    $ gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    
    0 讨论(0)
  • 2020-12-09 03:02
    sudo ln -s \ 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ \
    /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
    
    0 讨论(0)
  • 2020-12-09 03:07

    I encountered this while setting up a React Native project. This solution worked.

    sudo xcode-select --switch /Applications/Xcode.app
    
    0 讨论(0)
  • 2020-12-09 03:12

    gcc -version

    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

    0 讨论(0)
  • 2020-12-09 03:13

    For me the issue was I had not run

    xcode-select --install

    Once I did that everything ran fine

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