ayuwo
新手上路
新手上路
阅读:618回复:10

编译问题请教

楼主#
更多 发布于:2024-12-16 15:30


在国产麒麟系统 v10 sp1下编译github源码,下面这个问题应怎样查证解决?


kylin-pc:~/桌面/yong-master$ node build.js l64 -x l64-qt6 -x l64-gtk4
gcc -I/home/kylin/桌面/yong-master/llib -I/home/kylin/桌面/yong-master/im -I/home/kylin/桌面/yong-master/im/IMdkit -DCFG_XIM_YBUS -DCFG_XIM_IBUS `pkg-config --cflags ibus-1.0` -DCFG_XIM_FBTERM -I/home/kylin/桌面/yong-master/im/fbterm -DL_CALL_GLIB_SERVER -DL_CALL_GLIB_CLIENT -Wno-deprecated-declarations -D_GNU_SOURCE -Wall -g -O2 -fno-plt -fno-strict-aliasing -Wno-format-truncation -fms-extensions -pipe -ffast-math -I/home/kylin/桌面/yong-master/include -I/home/kylin/桌面/yong-master/common `pkg-config --cflags gtk+-3.0` -Wno-unused-const-variable -O0 -c /home/kylin/桌面/yong-master/common/keyboard.c -o keyboard.o
gcc -I/home/kylin/桌面/yong-master/llib -I/home/kylin/桌面/yong-master/im -I/home/kylin/桌面/yong-master/im/IMdkit -DCFG_XIM_YBUS -DCFG_XIM_IBUS `pkg-config --cflags ibus-1.0` -DCFG_XIM_FBTERM -I/home/kylin/桌面/yong-master/im/fbterm -DL_CALL_GLIB_SERVER -DL_CALL_GLIB_CLIENT -Wno-deprecated-declarations -D_GNU_SOURCE -Wall -g -O2 -fno-plt -fno-strict-aliasing -Wno-format-truncation -fms-extensions -pipe -ffast-math -I/home/kylin/桌面/yong-master/include -I/home/kylin/桌面/yong-master/common `pkg-config --cflags gtk+-3.0` -Wno-unused-const-variable -O0 -c /home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c -o ybus-wayland.o
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:60:66: error: unknown type name ‘GtkLayerShellKeyboardMode’
  60 | static void (*p_gtk_layer_set_keyboard_mode) (GtkWindow *window, GtkLayerShellKeyboardMode mode);
     |                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:105:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v1.h: In function ‘zwp_input_method_context_v1_destroy’:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v1.h:352:121: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 352 |     ZWP_INPUT_METHOD_CONTEXT_V1_DESTROY, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v1.h:352:121: note: each undeclared identifier is reported only once for each function it appears in
In file included from /home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:107:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h: In function ‘zwp_input_method_v2_destroy’:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h:658:105: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 658 |     ZWP_INPUT_METHOD_V2_DESTROY, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v2), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h: In function ‘zwp_input_popup_surface_v2_destroy’:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h:733:119: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 733 |     ZWP_INPUT_POPUP_SURFACE_V2_DESTROY, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_input_popup_surface_v2), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h: In function ‘zwp_input_method_keyboard_grab_v2_release’:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h:884:133: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 884 |     ZWP_INPUT_METHOD_KEYBOARD_GRAB_V2_RELEASE, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_input_method_keyboard_grab_v2), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h: In function ‘zwp_input_method_manager_v2_destroy’:
/home/kylin/桌面/yong-master/im/wayland/input-method-client-protocol-v2.h:948:121: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 948 |     ZWP_INPUT_METHOD_MANAGER_V2_DESTROY, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_input_method_manager_v2), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:108:
/home/kylin/桌面/yong-master/im/wayland/virtual-keyboard-v1.h: In function ‘zwp_virtual_keyboard_v1_destroy’:
/home/kylin/桌面/yong-master/im/wayland/virtual-keyboard-v1.h:208:113: error: ‘WL_MARSHAL_FLAG_DESTROY’ undeclared (first use in this function)
 208 |     ZWP_VIRTUAL_KEYBOARD_V1_DESTROY, NULL, p_wl_proxy_get_version((struct wl_proxy *) zwp_virtual_keyboard_v1), WL_MARSHAL_FLAG_DESTROY);
     |                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘preedit_draw’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:515:2: warning: format not a string literal and no format arguments [-Wformat-security]
 515 |  snprintf(out,sizeof(out),s);
     |  ^~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘load_gtk_layer_shell’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1184:3: error: ‘p_gtk_layer_set_keyboard_mode’ undeclared (first use in this function)
1184 |   p_gtk_layer_set_keyboard_mode=dlsym(l_so,"gtk_layer_set_keyboard_mode");
     |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘wayland_init_input_win’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1532:3: warning: implicit declaration of function ‘p_gtk_layer_set_keyboard_mode’ [-Wimplicit-function-declaration]
1532 |   p_gtk_layer_set_keyboard_mode(w,GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
     |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1532:35: error: ‘GTK_LAYER_SHELL_KEYBOARD_MODE_NONE’ undeclared (first use in this function)
1532 |   p_gtk_layer_set_keyboard_mode(w,GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
     |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘wayland_init_tip_win’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1579:35: error: ‘GTK_LAYER_SHELL_KEYBOARD_MODE_NONE’ undeclared (first use in this function)
1579 |   p_gtk_layer_set_keyboard_mode(w,GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
     |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘wayland_init_main_win’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1616:34: error: ‘GTK_LAYER_SHELL_KEYBOARD_MODE_NONE’ undeclared (first use in this function)
1616 |  p_gtk_layer_set_keyboard_mode(w,GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
     |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c: In function ‘wayland_init_keyboard_win’:
/home/kylin/桌面/yong-master/im/wayland/ybus-wayland.c:1636:34: error: ‘GTK_LAYER_SHELL_KEYBOARD_MODE_NONE’ undeclared (first use in this function)
1636 |  p_gtk_layer_set_keyboard_mode(w,GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
     |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
沙发#
发布于:2024-12-16 15:43
帮助中有写,安装 libgtk-layer-shell0-dev,libwayland-dev。


应该没有自己编译的必要吧,直接就能用吧。
ayuwo
新手上路
新手上路
板凳#
发布于:2024-12-16 18:10
我是国产麒麟操作系统ARM64环境。
kylin-pc:~$ sudo apt install libgtk-3-dev libgtk2.0-dev libxkbcommon-dev libibus-1.0-dev libcurl4-openssl-dev libwayland-dev libgtk-layer-shell-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
libwayland-dev 已经是最新版 (1.18.0-1kylin0.1k2)。
libgtk-3-dev 已经是最新版 (3.24.23-1kylin2k16.9)。
libgtk2.0-dev 已经是最新版 (2.24.32-4kylin4k1.1)。
libcurl4-openssl-dev 已经是最新版 (7.68.0-1kylin2.19)。
libibus-1.0-dev 已经是最新版 (1.5.22-2kylin2)。
libxkbcommon-dev 已经是最新版 (0.10.0-1)。
libgtk-layer-shell-dev 已经是最新版 (0.1.0-3)。
kylin-pc:~$ sudo apt install libgtk-layer-shell0-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
E: 无法定位软件包 libgtk-layer-shell0-dev


我看区别是 libgtk-layer-shell0-dev,但我本地是libgtk-layer-shell-dev 且没有libgtk-layer-shell0-dev
地板#
发布于:2024-12-16 18:18
应该也行,不同的系统包的名字不一样
ayuwo
新手上路
新手上路
4楼#
发布于:2024-12-17 18:43
dgod:应该也行,不同的系统包的名字不一样回到原帖


尝试了一些方法没有解决。
检查了依赖应该没问题,区别就两个:一是我本地包libgtk-layer-shell-dev,没有libgtk-layer-shell0-dev;二是我本地环境上没有libgtk-4-dev,我也没编译gtk4(编译时用 node build.js l64 -x l64-qt6 -x l64-gtk4 排除了)。其他包都有也安装了。


想问:
1、github源里的代码是否为较新的?还是另有地方下载到稳定版的源码?
2、查看了gtk-layer-shell头文件和网络查询,似乎编译错误提示中的 GtkLayerShellKeyboardMode、GTK_LAYER_SHELL_KEYBOARD_MODE_NONE等是gtk4下的属性。是否这方面的问题?
如何进一步排查请指导。
5楼#
发布于:2024-12-17 18:57
ayuwo:尝试了一些方法没有解决。
检查了依赖应该没问题,区别就两个:一是我本地包libgtk-layer-shell-dev,没有libgtk-layer-shell0-dev;二是我本地环境上没有libgtk-4-dev,我也没编译gtk4(编...
回到原帖
gtk-layer-shell是单独的包,你有什么就装什么,和gtk4没关系。你说的几个变量都是这个包里面的。
ayuwo
新手上路
新手上路
6楼#
发布于:2025-01-11 13:03
看到3.0更新,从github拖了最新源码,编译发现缺文件,查了源码目录里确实没有lconfig.h,求教。

kylin-pc:~/桌面/yong-master$ sudo ./im/yong-tool.sh --sysinfo
DIST debian found
sysinfo:
  DIST: debian
  CFG: /usr/share/im-config/data/10_yong
  HOST_ARCH: arm
  HOST_MACHINE: 64
  PATH_LIB32:
  PATH_LIB64: /usr/lib64
  HOST_TRIPLET32: arm-linux-gnu
  HOST_TRIPLET64: aarch64-linux-gnu
  IBUS_STATUS: 0
  GTK2_PATH64: /usr/lib/aarch64-linux-gnu/gtk-2.0
  GTK3_PATH64: /usr/lib/aarch64-linux-gnu/gtk-3.0
  GTK4_PATH64: /usr/lib/gtk-4.0
  GTK2_IMMODULES32:
  GTK2_IMMODULES64: /usr/lib/aarch64-linux-gnu/gtk-2.0/2.10.0/immodules.cache
  QT5_PATH32: /usr/lib/qt5
  QT5_PATH64: /usr/lib/aarch64-linux-gnu/qt5
--sysinfo Done


kylin-pc:~/桌面/yong-master$ node build.js l64 -x l64-qt6 -x l64-gtk4
clang -fpic -D_GNU_SOURCE -Wall -pipe -g -O2 -fno-plt -flto -ffast-math -Wno-invalid-source-encoding -c lenv.c -o l64/lenv.o
In file included from lenv.c:1:
./llib.h:17:10: fatal error: 'lconfig.h' file not found
#include "lconfig.h"
         ^~~~~~~~~~~
1 error generated.
7楼#
发布于:2025-01-11 13:13
没上传全,更新一下吧
tairgo
荣誉会员
荣誉会员
8楼#
发布于:2025-01-11 21:26
看得一脸懵逼,会编译和linux的很高端的样子呀。
ayuwo
新手上路
新手上路
9楼#
发布于:2025-01-21 17:45
dgod:gtk-layer-shell是单独的包,你有什么就装什么,和gtk4没关系。你说的几个变量都是这个包里面的。回到原帖
经排查确认,是本地gtk-layer-shell版本(libgtk-layer-shell-dev_0.1.0-3_arm64,下图左侧为libgtk-layer-shell-dev_0.8.0-1_arm64)比较旧,还没有这些变量和常数。经向麒麟官方确认,目前也无法升级这些版本包。所以现阶段无法解决这个问题了。



图片:2025-01-21_17-40-20.png




只能考虑之前某个版本的源码还不需要这些特性的,来编译使用。应当选哪个时间的版本(包括build.js)来作好?
上一页
游客

返回顶部