Building Gtk apps on OpenSolaris
I recently started playing with gtk on OpenSolaris and thought I'd post here the couple of packages you need to install to compile a simple gtk app. Took me a few minutes searching the web, would've been nice to get it all in one place. I'm running 2008.11 with the latest build, snv_111.
Given a short piece of code using gtk, like this one from the gtk tutorial:
#include <gtk/gtk.h>
int main(int argc, char **argv)
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
you'll need to install SUNWgnome-common-devel (for pkg-config), SUNWxwinc and SUNWxorg-headers (for header files). So just
# pfexec pkg install SUNWgnome-common-devel SUNWxwinc SUNWxorg-headersand then
# cc gtk_1.c -o gtk_1 `pkg-config --cflags --libs gtk+-2.0`and you're set.