Thursday, August 20, 2009

How to Create a GUI with C++ (Linux Edition)

There are 2 main options when creating a GUI in C++ while in Linux. The options are GTK+ or QT.

GTK+

If using GTK+ w/ C++ you will want to see this page.

Ubuntu Install Instructions:
  • sudo apt-get install libgtkmm-2.4-dev
Eclipse Setup Instructions:

Add this line to your code:
  • #include <gtkmm.h>
Add the following to your optimization settings for GCC C++ Compiler
  • `pkg-config gtkmm-2.4 --cflags --libs`
Add the following to your Directories settings for GCC C++ Compiler
  • /usr/lib/gtkmm-2.4
  • /usr/include/gtkmm-2.4
Add the following to your Libraries under GCC ++ Linker
  • Under Libraries (-l):
    gtkmm-2.4
Now if you follow the gtkmm website examples you should be able to run them in eclipse.

No comments:

Post a Comment