2017-01-22 24 views
0

我無法使用XCode 8.2.1在我的Mac OS X 10.11上運行C編譯器以正常運行。我安裝了最新的Xcode和刪除所有現有的gcc二進制文件,但仍然正在以下錯誤:使C編譯器在OS X上工作?

-- PCRE: Removing 'configure' log files 
-- PCRE: PCRE_WORKING_DIR: /Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE-prefix/src/PCRE-build 
-- PCRE: sh;/Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE-prefix/src/PCRE/configure;--prefix=/Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE;--disable-shared 
-- PCRE: Errors detected - See below. 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE-prefix/src/PCRE/install-sh -c -d 
checking for gawk... no 
checking for mawk... no 
checking for nawk... no 
checking for awk... awk 
checking whether make sets $(MAKE)... yes 
checking whether make supports nested variables... yes 
checking whether make supports nested variables... (cached) yes 
checking for style of include used by make... GNU 
checking for gcc... /Library/Developer/CommandLineTools/usr/bin/cc 
checking whether the C compiler works... no 
configure: error: in `/Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE-prefix/src/PCRE-build': 
configure: error: C compiler cannot create executables 
CMake Error at /Users/abc/Documents/Slicer/Slicer/CMake/ExternalProjectForNonCMakeProject.cmake:76 (message): 
    PCRE: Error in configure step. See 
    /Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE_configure_step_output.txt 
    and 
    /Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE_configure_step_error.txt 
Call Stack (most recent call first): 
    /Users/abc/Documents/Slicer/Slicer-SuperBuild-Debug/PCRE_configure_step.cmake:3 (ExternalProject_Execute) 
make[2]: *** [PCRE-prefix/src/PCRE-stamp/PCRE-configure] Error 1 
make[1]: *** [CMakeFiles/PCRE.dir/all] Error 2 
make: *** [all] Error 2 

如何使用C編譯器上我的配置是否正確?

+3

當你說你「刪除了所有現有的gcc二進制文件」時,你是什麼意思?您不應該刪除某些第三方(非Apple)安裝程序或軟件包管理器未安裝的任何內容。另外,當'configure'失敗時,詳細信息位於config.log文件中。你需要發佈相關摘錄。 –

+0

我建議你刪除Xcode然後重新安裝它。然後闡明您是要在Xcode中編譯(即使用Xcode GUI)還是通過終端中的命令行進行編譯。 –

回答

1

聽起來你想從命令行運行C編譯器(而不是Xcode)。

轉到Apple的開發人員站點download section並下載Command Line Tools (macOS 10.12) for Xcode 8.2。這可能需要一個活躍的開發者帳戶。

當前的直接鏈接是:Command Line Tools