A: 

You should be able to do this; however most of the X / Gtk libraries are normally compiled dynamically, and while they should compile statically you may encounter some bit-rot.

Have you considered simply bundling all the required shared libraries with your application? You could launch your application via a shell script wrapper which sets up the library search path to point to the directory with your shared libraries in.

This is similar to the method that firefox uses on Linux for it's plugin path.

Dave Rigby
+2  A: 

GTK and X are independent programs. You would typically need to install both for the program to work. Alternatively, you can use the Linux framebuffer by switching out GTK for GTKfb. You will need to compile GTKfb and its dependencies statically if you don't want to distribute the libraries. Carefully read the LGPL if you do this. Red Hat has a paper on building small applications with GTKfb: http://www.redhat.com/f/pdf/gtkfb.pdf.

Brian
Thanks, this was what I was searching for.
qwrty
+1  A: 

X libraries are X11 client libraries that are used to connect to X11 server. Your device does not run such server, and X11 client libraries won't be of any help. On embedded devices, the good option is probably to use direct access to framebuffer (e.g., gtk-directfb, gtk-fb)

dmitry_vk
A: 

You could use X Virtual Framebuffer. On Debian, it's the xvfb package. The following is from the package description:

Xvfb provides an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory. The primary use of this server was intended to be server testing, but other novel uses for it have been found, including testing clients against unusual depths and screen configurations, doing batch processing with Xvfb as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway.

This package also contains a convenience script called xvfb-run which simplifies the automated execution of X clients in a virtual server environment. This convenience script requires the use of the xauth program.

More information about X.Org can be found at:

http://www.X.org

http://xorg.freedesktop.org

http://lists.freedesktop.org/mailman/listinfo/xorg

This package is built from the X.org xserver module.

supercheetah