下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