Saturday, May 28, 2016

how to install gtkmm on CENTOS 7 / RedHat 7 / Fedora in 3 steps

To Install gtkmm on centos 7 / RedHat 7/ Fedora follow the 3 steps bellow
  •  step 1 : install the updates 

sudo yum update 

  • step 2 :   Install Development Tools (this group of tools contain all requirement you need to compile your code)

 sudo yum groupinstall 'Development Tools'


  • step 3 : Install gtkmm  

 sudo yum install gtkmm30-devel  


Now after doing this 3 steps the installation is done you need now to create a simple application example and compile it to check if every thing is working .
you can copy past the example bellow to chack if your environment is ready to start programing with gtkmm 

  • first step you need to create a c++ file like the example
in our example the file name is GtkmmTutorial.cpp

 #include <gtkmm.h>

int main(int argc, char *argv[])
{
 
  Gtk::Main kit(argc, argv);
  Gtk::Window GtkmmTutorial;
  GtkmmTutorial.set_default_size(400, 400);
  Gtk::Main::run(GtkmmTutorial);

  return 0;
}



  • second step compile your code you can replace "GtkmmTutorial.cpp" by your file name and the output file "GtkmmTutorial" by any name you want
g++ GtkmmTutorial.cpp -o GtkmmTutorial `pkg-config gtkmm-3.0 --cflags --libs`

  • last step after compiling your code  you will see a new executable file, just double click on it and you will see an empty window 


if you don't  have any problem with this steps, you are now ready to start programing with gtkmm, but if you have any problem with installation jut leave comment with your problem details i will reply you with the solution.



1 comment:

  1. 1. went thru the first three steps - no errors thrown in any
    2. created the .cpp file
    3. simply entered g++ .cpp file and it threw error:
    fatal error: gtkmm.h file not found

    could not find any gtkmm.h file anywhere

    appreciate any insight

    ReplyDelete