Help Installing GTK+3.2230

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
oscarTheGrouch
Level 1
Level 1
Posts: 40
Joined: Mon Oct 17, 2016 7:25 pm

Help Installing GTK+3.2230

Post by oscarTheGrouch » Mon Jun 11, 2018 11:31 pm

Hello all,
I'm trying to install the latest version of GTK but it's seem beyond my Linux expertise.
The web sit list these requirements ..
You will need to get the GLib, GObject-Introspection, Pango, Gdk-Pixbuf, ATK and GTK+ packages to build GTK+.
You may also need some of the external dependencies that are also linked for each version listed below.

I downloaded the tar file and extracted it to a folder (gtk+-3.22.30). The documentation says to start with running the script file "configure which you then run to take the template makefiles called Makefile.in in the package and create makefiles customized for your operating system."

I did this and get the following config errors ..
No package 'glib-2.0' found
No package 'atk' found
No package 'pango' found
No package 'cairo' found
No package 'cairo-gobject' found
No package 'gdk-pixbuf-2.0' found

Here is link to documentation https://developer.gnome.org/gtk3/stable ... lding.html

I'm kinda stuck at this point and don't know how to get these packages or install them.
Any help would be appreciated.
Thanks,
OtG

User avatar
xenopeek
Level 24
Level 24
Posts: 23122
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Help Installing GTK+3.2230

Post by xenopeek » Mon Jun 11, 2018 11:43 pm

This will break Linux Mint 17.x and 18.x. Linux Mint 19 comes with Gtk+ 3.22. So before you waste a lot of time, why do you want this Gtk version? On Linux Mint 18.3 you can use Flatpak to install newer version of Gnome programs, if that is what you want to ultimately use this for. Look to the program you want if they have a Flatpak for it.

As for the not found errors, you're required to install the development packages of those libraries. But answer first why you need to as proceeding with this on Linux Mint 17.x or 18.x will cause system breakage.
Image

oscarTheGrouch
Level 1
Level 1
Posts: 40
Joined: Mon Oct 17, 2016 7:25 pm

Re: Help Installing GTK+3.2230

Post by oscarTheGrouch » Tue Jun 12, 2018 12:05 am

Thank you for the reply.
"Linux Mint 19 comes with Gtk+ 3.22. So before you waste a lot of time, why do you want this Gtk version?"
I'm not stuck on using a certain version of GTK, just wanted to try and write some GUI programs using Netbeans and GTK looked like a good way to do that.
I am using Linux Mint 18 'Sarah'. Would I have to reinstall Linux to get to 19?
Thamks,
OtG

User avatar
xenopeek
Level 24
Level 24
Posts: 23122
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Help Installing GTK+3.2230

Post by xenopeek » Tue Jun 12, 2018 1:49 am

After the final release of Linux Mint 19 is out, an upgrade path will open in Update Manager for upgrading in place (expected in 3-4 weeks). It will be announced on https://blog.linuxmint.com/.

That said, you don't need Gtk 3.22 to be able to program Gtk 3. Linux Mint 18.x come with Gtk 3.18 so you could start with that. But I can understand wanting to use Gtk 3.22. In any case, while there are ways to install Gtk 3.22 on Linux Mint 18.x it will break any program that relies on Gtk 3.18 in a way that is incompatible with Gtk 3.22. Cinnamon needs adjustments to work with that Gtk version AFAIK. Which is why the new version of Cinnamon comes with Linux Mint 19.

What programming language will you be using? I'd perhaps start getting familiar with basic Gtk programming and move to Linux Mint 19 for Gtk 3.22 as your next developer base.
Image

JosephM
Level 6
Level 6
Posts: 1079
Joined: Sun May 26, 2013 6:25 pm

Re: Help Installing GTK+3.2230

Post by JosephM » Tue Jun 12, 2018 3:09 am

As xenopeek said you don't need to build gtk to write applications with it. You will likely need to install the -dev packages to build your gtk apps. There are some good tutorials around on the web for getting started with gtk programming depending on the language you are using.
When I give opinions, they are my own. Not necessarily those of any other Linux Mint developer or the Linux Mint project as a whole.

oscarTheGrouch
Level 1
Level 1
Posts: 40
Joined: Mon Oct 17, 2016 7:25 pm

Re: Help Installing GTK+3.2230

Post by oscarTheGrouch » Wed Jun 13, 2018 12:10 am

xenopeek wrote:
Tue Jun 12, 2018 1:49 am
After the final release of Linux Mint 19 is out, an upgrade path will open in Update Manager for upgrading in place (expected in 3-4 weeks). It will be announced on https://blog.linuxmint.com/.
Thanks I'll keep an eye open for it.
xenopeek wrote:
Tue Jun 12, 2018 1:49 am
Linux Mint 18.x come with Gtk 3.18 so you could start with that. But I can understand wanting to use Gtk 3.22. In any case, while there are ways to install Gtk 3.22 on Linux Mint 18.x it will break any program that relies on Gtk 3.18 in a way that is incompatible with Gtk 3.22. Cinnamon needs adjustments to work with that Gtk version AFAIK. Which is why the new version of Cinnamon comes with Linux Mint 19.
I've tried 3.18 and can't seem to make any sense of it. Documentation that I have found is Greek to me. I'll wait on Mint 19. Is Update Manager going to update my 'Sarah' version??
xenopeek wrote:
Tue Jun 12, 2018 1:49 am
What programming language will you be using? I'd perhaps start getting familiar with basic Gtk programming and move to Linux Mint 19 for Gtk 3.22 as your next developer base.
Netbeans using C/C++. There is a GTK sample program but can't get it to work without GTK installed. I'm in no rush so I will wait for Mint 19.
I've domne a lot of Microchip PIC programming (it uses a version of Netbeans) and I need a PC app to interface with a PIC project I'm working on.
Thanks for the help, I REALLY appreciate it.
OtG

User avatar
xenopeek
Level 24
Level 24
Posts: 23122
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Help Installing GTK+3.2230

Post by xenopeek » Wed Jun 13, 2018 1:38 am

There will be a new option in the menu of Update Manager for upgrading. It will become available shortly after final release of Linux Mint 19 and will be announced on the blog.

As for the GTK sample programs, might you perhaps not have installed the development libraries like JosephM referred to? Like you need libgtk-3-dev package installed minimum to be able to compile programs using GTK.

I'd also suggest to install a bunch of additional programs for documentation and examples for your GTK version:
  • apt install devhelp libgtk-3-doc libglib2.0-doc libpango1.0-doc to get reference manuals for programming GTK, GLib and related libraries. You'll find Devhelp in the Programming category of your menu where you can access all.
  • apt install gtk-3-examples to get a bunch of example programs showcasing what you can do with GTK. Like gtk3-demo to see a list of examples with description and source code and a Run button to run each demo. And gtk3-widget-factory to get a nice window showing you all possible widget (UI elements) of GTK.
  • apt install gnome-devel-docs to get more guides for programming GTK. You can then run any of the following commands to access the developer guides for your GTK version.

    Code: Select all

    yelp /usr/share/help/C/accessibility-devel-guide
    yelp /usr/share/help/C/gnome-devel-demos
    yelp /usr/share/help/C/hig
    yelp /usr/share/help/C/optimization-guide
    yelp /usr/share/help/C/platform-overview
    yelp /usr/share/help/C/programming-guidelines
Now obviously the latter two not installing menu entries (for some reason) isn't very convenient. I some time back created the following script to make all of the above appear in the Programming category of the menu (if they are installed) so you don't need to run any commands from terminal to access them. Just copy the below code and put it in a plain text file. Save it somewhere then open a terminal on the directory where you save it. Run bash filename where filename is the name of your file and it should run and tell you it created a bunch of menu entries.

Code: Select all

#!/bin/bash

mkdir -p ~/.local/share/applications/

echo "gnome-devel-docs"

echo ">>> Removing old files"
rm -v ~/.local/share/applications/gnome-devel-docs-*.desktop

echo ">>> Creating new files"
dirs=( $(dpkg -L gnome-devel-docs | grep /usr/share/help/C/. | cut -d'/' -f1-6 | sort -u) )
for dir in "${dirs[@]}"; do
	title=$(basename ${dir} | sed -r 's/-/ /g; s/[a-z]*/\u&/g; s/Gnome|Hig/\U&/')
	echo -e "\tCreating file for ´$title´"
	cat >~/.local/share/applications/gnome-devel-docs-$(basename ${dir}).desktop <<END
[Desktop Entry]
Type=Application
Name=${title}
Icon=devhelp
Exec=yelp ${dir}
Terminal=false
Categories=GNOME;GTK;Development;
StartupNotify=true
END
done

echo
echo "gtk3"

echo ">>> Removing old files"
rm -v ~/.local/share/applications/gtk3-*.desktop

echo ">>> Creating new files"
files=( $(grep '^NoDisplay=true$' /usr/share/applications/gtk3-* | cut -d':' -f1) )
for file in "${files[@]}"; do
	title=$(grep '^Name=' ${file} | sed -r 's/^Name=//')
	echo -e "\tCreating file for ´$title´"
	sed -r 's/^(NoDisplay=)true$/\1false/' "$file" > "${HOME}/.local/share/applications/$(basename "${file}")"
done

echo
echo ">>> Done"
Image

JosephM
Level 6
Level 6
Posts: 1079
Joined: Sun May 26, 2013 6:25 pm

Re: Help Installing GTK+3.2230

Post by JosephM » Wed Jun 13, 2018 2:52 am

Just to reiterate, you MUST install the *-dev packages for the libraries you are trying to use. These are not installed in Mint by default since most users have no need for them. Upgrading to Mint19 isn't going to make any difference here. If you can't get it working in Mint18 it isn't going to work in 19 either.

To see if things are working correctly try something super simple. Go here https://developer.gnome.org/gtk3/unstab ... arted.html

Try copying the text from the very first example program into a simple text editor (Xed, Gedit, whatever works for you). Save it somewhere on your drive. Navigate to the directory where you saved it in the terminal and try running the provided command

Code: Select all

gcc `pkg-config --cflags gtk+-3.0` -o example-0 example-0.c `pkg-config --libs gtk+-3.0`
It should build fine and leave you with an executable that you can run that shows you a simple empty window. If it doesn't, something isn't set up correctly.
When I give opinions, they are my own. Not necessarily those of any other Linux Mint developer or the Linux Mint project as a whole.

oscarTheGrouch
Level 1
Level 1
Posts: 40
Joined: Mon Oct 17, 2016 7:25 pm

Re: Help Installing GTK+3.2230

Post by oscarTheGrouch » Fri Jun 15, 2018 1:28 am

This is helpful. The rest I will have to study on/ Thanks for the reply and the others. I will look and try to follow as I get time.
OtG

Post Reply

Return to “Software & Applications”