ubuntu20.04编译全志H6 linux Qt源码
cd cqh6_linux3.10_qt/
export XY=1024x600
./build
如果出现错误
You seem to have the current working directory in your
LD_LIBRARY_PATH environment variable. This doesn't work.
make[1]: *** [support/dependencies/dependencies.mk:22: core-dependencies] Error 1
make: *** [Makefile:79: _all] Error 2
ERROR: build buildroot Failed
执行
LD_LIBRARY_PATH=
然后继续编译
出现错误
freadahead.c: In function 'freadahead':
freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
执行
cd buildroot-2017.02.3/output/build/host-m4-1.4.18/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
cd -
然后继续编译
出现错误
gdbusauth.c: In function ‘_g_dbus_auth_run_server’:
gdbusauth.c:1298:11: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
1298 | debug_print ("SERVER: WaitingForBegin, read '%s'", line);
以及错误
gdbusmessage.c: In function ‘g_dbus_message_to_blob’:
gdbusmessage.c:2698:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
2698 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
编辑 ./buildroot-2017.02.3/output/build/host-libglib2-2.50.2/gio/gdbusauth.c
把1298行的 debug_print ("SERVER: WaitingForBegin, read '%s'", line);
移到if语句块后面
1298 //debug_print ("SERVER: WaitingForBegin, read '%s'", line);
1299 if (line == NULL)
1300 goto out;
1301 debug_print ("SERVER: WaitingForBegin, read '%s'", line);
编辑./buildroot-2017.02.3/output/build/host-libglib2-2.50.2/gio/gdbusmessage.c
把2698行的tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
移到if else 语句块后面。
2698 //tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
2699 if (signature == NULL)
2700 {
2701 g_set_error (error,
2702 G_IO_ERROR,
2703 G_IO_ERROR_INVALID_ARGUMENT,
2704 _("Message body has signature '%s' but there is no signature header"),
2705 signature_str);
2706 g_free (tupled_signature_str);
2707 goto out;
2708 }
2709 else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
2710 {
2711 g_set_error (error,
2712 G_IO_ERROR,
2713 G_IO_ERROR_INVALID_ARGUMENT,
2714 _("Message body has type signature '%s' but signature in the header field is '%s'"),
2715 tupled_signature_str, g_variant_get_type_string (message->body));
2716 g_free (tupled_signature_str);
2717 goto out;
2718 }
2719 tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
继续编译
出现错误
digitlst.cpp:67:13: fatal error: xlocale.h: No such file or directory
67 | # include <xlocale.h>
执行
find . -name digitlst.cpp #找到这个文件的路径
#注释掉67行
搞掉,继续编译
出现错误
lib/fseterr.c: In function 'fseterr':
lib/fseterr.c:77:3: error: #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
执行
cd ./buildroot-2017.02.3/output/build/host-bison-3.0.4/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
cd -
如果提示缺少某些头文件之类的错误,百度安装相对应的依赖库,如
sudo apt-get install texinfo hgsubversion
然后继续编译。
编译成功后,
烧录,运行,终于成功地没运行起来。