您的位置:首页 > 其它

cmake 提示gcc或交叉编译 broken

2016-05-05 19:58 507 查看
cmake
reports gcc is broken. Where do I start?

-- Check for working C compiler: /usr/bin/gcc -- broken

CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Could not determine Eclipse version, assuming at least 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION
if this is wrong.
-- Check for working C compiler: /usr/bin/gcc-4.6
-- Check for working C compiler: /usr/bin/gcc-4.6 -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/bin/gcc-4.6" is not able to compile a
simple testprogram.

解决

check this Link. i had the
same problem. i think the problem is that you need more parameters to compile (like linker-script, flags ...). change your CMakeLists like this and try it again:
INCLUDE(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(gcc GNU)
CMAKE_FORCE_CXX_COMPILER(g++ GNU)


do not forget to set the path to the compiler in your enviroment vars.

参考 http://stackoverflow.com/questions/16594053/cmake-reports-gcc-is-broken-where-do-i-start
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: