找回密码
 立即注册
首页 业界区 安全 CMakeFile.txt通过sysroot方式后生成makefile报错 ...

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

滑清怡 2025-6-8 12:26:35
怪不得博客园干不过别家,体验真的不太好。通过openwrite发布文章,其他平台都能发布,就博客园限制了,理由是文字少的文章限制发布到该平台。
哎,这种行为当真是扶不起的阿斗。以后也不要太把博客园当回事了,迟早要关门的
1.png

报错信息如下:
  1. -- The C compiler identification is unknown
  2. -- The CXX compiler identification is unknown
  3. -- Check for working C compiler: /home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc
  4. -- Check for working C compiler: /home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc -- broken
  5. CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
  6.         The C compiler
  7.                 "/home/xj/asm/host/bin/aarch64-buildroot-linux-gnu-gcc"
  8.         is not able to compile a simple test program.
  9.         It fails with the following output:
  10.                 Change Dir: /home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp
  11.                 Run Build Command:"/usr/bin/make" "cmTC_ee744/fast"
  12.                 /usr/bin/make -f CMakeFiles/cmTC_ee744.dir/build.make CMakeFiles/cmTC_ee744.dir/build
  13.                 make[1]: Entering directory '/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp'
  14.                 Building C object CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj
  15.                 /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
  16.                 /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
  17.                 CMakeFiles/cmTC_ee744.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj' failed
  18.                 make[1]: *** [CMakeFiles/cmTC_ee744.dir/testCCompiler.c.obj] Error 1
  19.                 make[1]: Leaving directory '/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeTmp'
  20.                 Makefile:126: recipe for target 'cmTC_ee744/fast' failed
  21.                 make: *** [cmTC_ee744/fast] Error 2
  22.         CMake will not be able to correctly generate this project.
  23. Call Stack (most recent call first):
  24.         CMakeLists.txt:18 (project)
  25. -- Configuring incomplete, errors occurred!
  26. See also "/home/xj/asm/lv_mygui/S5_LVGL/CMakeFiles/CMakeOutput.log".
  27. 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发现它在
2.png

然后修改了CMakeFile.txt里的这句发现cmake 可以执行了
3.png

但是make还是报错
4.png

进入这个目录查看下具体文件信息
5.png

发现有软连接
查看连接发现
6.png

将host/lib里的此文件复制到这里来
7.png

在查看软连接发现就有了
8.png

然后再重新cmake后再make,可以正常执行了!
本文由博客一文多发平台 OpenWrite 发布!

来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
您需要登录后才可以回帖 登录 | 立即注册