Tuesday, January 28, 2014

Install GTK+3 and compile with gcc in Linux

To install GTK+3 to develop GUI program on Linux (eg.Ubuntu), you have to install libgtk-3-dev, enter the command in Terminal:
$ sudo apt-get install libgtk-3-dev

To compile your souce code using gcc, with GTK+3:
$ gcc <your_code>.c -o <your_code> `pkg-config --cflags --libs gtk+-3.0`

where <your_code>.c is your c source code. <your_code> is the generated program.

Notice the symbol `, not ' or ".

Then run it with:
$ ./<your_code>

Check a example: Send data to Arduino from Linux PC, program in C with GUI of GTK+3, as ColorChooser

No comments:

Post a Comment