找不到Vala包‘xxxx’

k2fxgqgv  于 2022-09-20  发布在  其他
关注(0)|答案(2)|浏览(144)

系统信息。

⭕ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"

⭕ valac --version
Vala 0.48.6

编译错误。

⭕ valac --pkg gtk+-3.0  --pkg posix list-exec.vala
error: Package `glib-2.0' not found in specified Vala API directories or GObject-Introspection GIR directories
error: Package `gobject-2.0' not found in specified Vala API directories or GObject-Introspection GIR directories
error: Package `gtk+-3.0' not found in specified Vala API directories or GObject-Introspection GIR directories
error: Package `posix' not found in specified Vala API directories or GObject-Introspection GIR directories
Compilation failed: 4 error(s), 0 warning(s)

大多数开发包都已安装。

⭕ pkg-config --cflags --libs gtk+-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include.......

⭕ pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/x86......

⭕ pkg-config --cflags --libs gobject-2.0
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-l......

找不到POSIX包。

⭕ pkg-config --cflags --libs posix
Package posix was not found in the pkg-config search path.
Perhaps you should add the directory containing `posix.pc'
to the PKG_CONFIG_PATH environment variable
No package 'posix' found

VAPI目录在这里。

⭕ l /usr/share/vala/vapi/
gcalc-2.deps  gcalc-2.vapi  gci-1.deps  gci-1.vapi

那么,我如何才能修复这些问题呢?

k97glaaz

k97glaaz1#

看起来PPA有自己的VAPI包:valac-0.48-vapi

ls /usr/share/vala-0.48/vapi/ | grep -P ^(gtk|glib|gobject|posix)应该显示如下内容:

glib-2.0.vapi
gobject-2.0.deps
gobject-2.0.vapi
gtk+-3.0.deps
gtk+-3.0.vapi
gtk4.deps
gtk4-unix-print.deps
gtk4-unix-print.vapi
gtk4.vapi
posix.vapi
93ze6v8z

93ze6v8z2#

我得到了一个类似的编译错误,this answer为我解决了这个问题:

sudo apt install libgirepository1.0-dev

相关问题