I use Freya (0.3.2) and I tested the webkit4 (LINK), but do not work. The code is:

public class Envideos : Gtk.Window {
    public Envideos () {
    this.title = "Envideos";
    this.window_position = Gtk.WindowPosition.CENTER;
    this.destroy.connect (Gtk.main_quit);
    this.set_default_size (800, 600);

    WebKit.WebView thewebview2 = new WebKit.WebView();

public static int main (string[] args) {
    Gtk.init (ref args);
    Envideos window = new Envideos ();
    window.show_all ();
    Gtk.main ();
    return 0;

Ok, now I run valac and the resul is:

valac --pkg gtk+-3.0 --pkg webkit2gtk-4.0 testwebkit4.vala
testwebkit4.vala:8.17-8.50: warning: local variable `thewebview2' declared but never used
WebKit.WebView thewebview2 = new WebKit.WebView();
/home/jockerfox/Projects-Eos/envideos/src/testwebkit4.vala.c:8:29: fatal error: webkit2/webkit2.h: File o directory non esistente 
#include <webkit2/webkit2.h>
compilation terminated.
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)

Obviusly, forgotten the warning but concentrate to error. Note that I have got the libwebkit2gtk-3.0-dev installed on my Freya.

Where I wrong ?

  • 1
    You are trying to compile with the v4 webkit2 package and you have installed v3 package.
    – bitseater
    Dec 13 '15 at 19:57
  • Hi bitseater. Thanks to replay. The valadoc.org say webkit-1.0 package is deprecated. So we need use webkit2gtk-4.0. Maybe my Freya use the v3, how can update the package to v4 ?
    – jockerfox
    Dec 15 '15 at 15:26

According with Valadoc , webkit2gtk-3.0 bindings are replaced in Vala by webkit2gtk-4.0 since version 0.25.2 .

In order to install webkit2gtk-4.0 you can try in terminal:

sudo add-apt-repository ppa:webkit-team/ppa
sudo apt-get update
sudo apt-get install libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-dev

If you want to access the WebKit2 documentation, you must run in terminal:

sudo apt-get install libwebkit2gtk-4.0-doc

More info about webkit2gtk-4.0 at:

WebKitGTK+ Project

WebKitGTK+ Valadoc reference


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.