Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Self contained GTK application when there is no X windows environment

Tags:

linux

x11

gtk

I am using a very stripped down version of Linux, I want to create a self contained GTK application on a system that has no X window environment installed. I want to use GTK GUI classes and widgets and not create a server version where GUI is disabled.

The only thing you can expect is a working glibc.

From what I understand it would involve the following:

  • Statically link GTK lib with X libraries.
  • Statically link my application with the above mentioned library.

    Is there anything to watch out for, Can a (somewhat) newbie get it done. I used google, but (some usable) information flew over my head.
  • like image 419
    qwrty Avatar asked Jan 24 '23 06:01

    qwrty


    1 Answers

    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.

    like image 100
    Brian Avatar answered Apr 27 '23 21:04

    Brian