系统信息。
⭕ 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
那么我该如何解决这些问题呢?
最佳答案
看起来 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
关于ubuntu - 未找到 vala 包 'xxxx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67177693/