Statically link a GTK + WebKit 1.0 application -
i created or adapted simple webkit-1.0
demo (consisting of window webview inside displaying local html file):
// from: https://wiki.gnome.org/projects/webkitgtk/programmingguide/tutorial #include <gtk/gtk.h> #include <webkit/webkit.h> static void destroywindowcb(gtkwidget* widget, gtkwidget* window) { gtk_main_quit(); } static gboolean closewebviewcb(webkitwebview* webview, gtkwidget* window) { gtk_widget_destroy(window); return true; } int main(int argc, char* argv[]) { gtk_init(&argc, &argv); gtkwidget *main_window = gtk_window_new(gtk_window_toplevel); gtk_window_set_default_size(gtk_window(main_window), 800, 600); webkitwebview *webview = webkit_web_view(webkit_web_view_new()); gtk_container_add(gtk_container(main_window), gtk_widget(webview)); g_signal_connect(main_window, "destroy", g_callback(destroywindowcb), null); g_signal_connect(webview, "close", g_callback(closewebviewcb), main_window); webkit_web_view_load_uri(webview, ".../test.html"); gtk_widget_grab_focus(gtk_widget(webview)); gtk_widget_show_all(main_window); gtk_main(); return 0; }
compiling application
g++ owb.cpp `pkg-config --cflags --libs gtk+-2.0 webkit-1.0`
works fine. but want create static build of this , therefore use following command:
g++ owb.cpp -static `pkg-config --static --cflags --libs gtk+-2.0 webkit-1.0`
but command results in heavy error message:
$ g++ owb.cpp -static `pkg-config --static --cflags --libs gtk+-2.0 webkit-1.0` /usr/bin/ld: cannot find -lgdk_pixbuf-2.0 /usr/bin/ld: cannot find -latk-1.0 /usr/bin/ld: cannot find -lharfbuzz /usr/bin/ld: cannot find -lwebkitgtk-1.0 /usr/bin/ld: cannot find -ljavascriptcoregtk-1.0 /usr/bin/ld: cannot find -lffi ... warnings skipped ... collect2: error: ld returned 1 exit status
when try ldconfig -p | grep gdk_pixbuf-2.0
get:
$ ldconfig -p | grep gdk_pixbuf-2.0 libgdk_pixbuf-2.0.so.0 (libc6) => /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0 libgdk_pixbuf-2.0.so (libc6) => /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so
and other libraries, too.
so what's wrong?
Comments
Post a Comment