下GCC當cmake-gui
我的OSX平臺上運行configure
,我碰到下面的錯誤發生的歷史:破碎CMake和OSX
The C compiler identification is GNU
The CXX compiler identification is GNU
Checking whether C compiler has -isysroot
Checking whether C compiler has -isysroot - yes
Checking whether C compiler supports OSX deployment target flag
Checking whether C compiler supports OSX deployment target flag - yes
Check for working C compiler: /usr/bin/gcc-4.0
Check for working C compiler: /usr/bin/gcc-4.0 -- broken
CMake Error at /Applications/CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/bin/gcc-4.0" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /Users/bill/Desktop/cmake_test/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory
`/Users/bill/Desktop/cmake_test/build/CMakeFiles/CMakeTmp'
"/Applications/CMake 2.8-2.app/Contents/bin/cmake" -E cmake_progress_report
/Users/bill/Desktop/cmake_test/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
/usr/bin/gcc-4.0 -isysroot -o
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
/Users/bill/Desktop/cmake_test/build/CMakeFiles/CMakeTmp/testCCompiler.c
i686-apple-darwin10-gcc-4.0.1:
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o: No such file or
directory
<snip>
從看互聯網上的論壇等,我已經建立,這可能是用我的PATH變量。這裏是我的分析PATH變量:
! echo $PATH
/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/sw/bin:/sw/sbin:/Applications/MATLAB_R2012a.app/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin
,當我配置的Python這個路徑變量最近已改變,我認爲,海灣合作委員會的問題必須在相同的排序時間如雨後春筍般涌現。我的系統安裝出現這種情況可能會出現什麼問題?
一些更多的細節。由CMAKE_MAKE_PROGRAM
指定的構建程序是/opt/local/bin/gmake
。
我也發現這些錯誤只有在cmake-gui
中運行Configure
時纔會引發。在命令行(從構建文件夾中運行cmake ..
),配置精細完成:
! cmake ..
-- The C compiler identification is GNU 4.0.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc-4.0
-- Check for working C compiler: /usr/bin/gcc-4.0 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
然而,編譯並不總是使用一些庫時全成 - 例如參見this question I have asked here。因此,我認爲cmake
過程中可能仍然存在問題。
失敗的編譯測試的輸出可能是該日誌中最有用的信息。 – Mat 2013-05-09 15:52:21
謝謝,我已經包含了完整的CMake輸出。它看起來像也許創建的對象文件不能正常工作? – 2013-05-09 15:58:13
然後檢查你的安裝binutils – bikram990 2013-05-10 05:51:29