CMakeFile.txt通过sysroot方式后生成makefile报错

file 报错信息如下:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc
-- Check for working C compiler: /home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc -- broken
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
    The C compiler

        "/home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

        Change Dir: /home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp

        Run Build Command:"/usr/bin/make" "cmTC_ee744/fast"
        /usr/bin/make -f CMakeFiles/cmTC_ee744.dir/build.make CMakeFiles/cmTC_ee744.dir/build
        make[1]: Entering directory '/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp'
        Building C object CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj
        /home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc    -o CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj   -c /home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp/testCCompiler.c
        /home/xj/asm/host/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/10.3.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
        CMakeFiles/cmTC_ee744.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj' failed
        make[1]: *** [CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj] Error 1
        make[1]: Leaving directory '/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp'
        Makefile:126: recipe for target 'cmTC_ee744/fast' failed
        make: *** [cmTC_ee744/fast] Error 2




    CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
    CMakeLists.txt:18 (project)


-- Configuring incomplete, errors occurred!
See also "/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeOutput.log".
See also "/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeError.log".

关键信息: '/home/xj/asm/host/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/10.3.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory'

搜索libmpfr.so.4发现它在 file

然后修改了CMakeFile.txt里的这句发现cmake 可以执行了 file 但是make还是报错 file 进入这个目录查看下具体文件信息 file 发现有软连接 查看连接发现 file 将host/lib里的此文件复制到这里来 file

在查看软连接发现就有了 file

然后再重新cmake后再make,可以正常执行了!

本文由博客一文多发平台 OpenWrite 发布!

  • 9
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值