ubuntu - 未找到 vala 包 'xxxx'

标签 ubuntu compilation vala

系统信息。

⭕ 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/

相关文章:

css - sass --watch : Compile only 1 css with many sources

c - 相当于 GLib 中的 open(O_WRONLY | O_CREAT)?

vala - 字符串插值/字符串模板如何工作?

Vala:通过处理程序 ID 与类析构函数断开信号处理程序失败 - 为什么?

ant - 使用 ant : [java] error(7): cannot find or open file: *. g 从源代码构建 ANTLR v4 时出现问题

c++ - GCC -flto 更改符号可见性

Bash:找不到命令

node.js - 未知错误 : SyntaxError: Unexpected token 'export' on ng command

c++ - Ubuntu:gethostbyaddr 返回 NULL 和 HOST_NOT_FOUND 错误

android studio中未指定android sdk