3

system information.

⭕ 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

compile error.

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

most development packages had been installed.

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

can not found posix package.

⭕ 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 directory here.

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

So how can I fixed those?

eexpress
  • 386
  • 1
  • 14

2 Answers2

1

Looks like the PPA has its own package for VAPIs: valac-0.48-vapi

ls /usr/share/vala-0.48/vapi/ | grep -P \^\(gtk\|glib\|gobject\|posix\) should show something like this:

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
AlThomas
  • 4,169
  • 12
  • 22
  • 1
    Thanks. It so stranger, `valac` depends on `valac-0.48-vapi`, but in my system, the valac-0.48-vapi package not here. – eexpress Apr 25 '21 at 06:30
0

I got a similar compile error, and this answer solved it for me:

sudo apt install libgirepository1.0-dev
Rasmus
  • 143
  • 7
  • This answer is useful for solving `Dependency "gobject-introspection-1.0" not found, tried pkgconfig and cmake` – Alexis Aug 14 '23 at 08:10