CMakeFile.txt透過sysroot方式後生成makefile報錯

月笼纱發表於2024-06-03

怪不得部落格園幹不過別家,體驗真的不太好。透過openwrite釋出文章,其他平臺都能釋出,就部落格園限制了,理由是文字少的文章限制釋出到該平臺。

哎,這種行為當真是扶不起的阿斗。以後也不要太把部落格園當回事了,遲早要關門的

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 釋出!

相關文章