CMakeFile.txt通過sysroot方式后生成makefile報錯
怪不得博客園干不過別家,體驗真的不太好。通過openwrite發布文章,其他平臺都能發布,就博客園限制了,理由是文字少的文章限制發布到該平臺。
哎,這種行為當真是扶不起的阿斗。以后也不要太把博客園當回事了,遲早要關門的

報錯信息如下:
-- 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發現它在

然后修改了CMakeFile.txt里的這句發現cmake 可以執行了

但是make還是報錯

進入這個目錄查看下具體文件信息

發現有軟連接
查看連接發現

將host/lib里的此文件復制到這里來

在查看軟連接發現就有了

然后再重新cmake后再make,可以正常執行了!
本文由博客一文多發平臺 OpenWrite 發布!
本文來自博客園,作者:xjxcxjx,轉載請注明原文鏈接:http://www.rzrgm.cn/xjxcxjx/p/18228807,謝絕CSDN轉載!
浙公網安備 33010602011771號