WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Getting GTK3 to work with RPi  (Read 3144 times)

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Getting GTK3 to work with RPi
« on: May 03, 2018, 05:59:01 AM »
Hi,

I am having trouble getting GTK3 installed and running.  First off I have the added complication that I am using Netbeans and compiling programs through windows via network to the RPi 1 B+.  I have the g++ running and have compiled and run a simple program. 

I am following this guide (http://www.raspberry-projects.com/pi/programming-in-c/gui-programming-in-c/gtk/installing-gtk) for installing GTK3, but am not able to get pk-config to work as it tells me the directory for gtk+-3.0 does not exist.  The result is that Netbeans does not find the header file gtk.h.  I am also having trouble locating all of the directories/libraries needed for Netbeans to work properly.  Is there a PiCore GTK installation guide I might be able to follow as most are written for Raspbian.

Installed the following tcz packages using the appInstaller
gtk3.tcz
gtk3-doc.tcz
gtk3-demo.tcz
gtk3-gir.tcz
gtk3-dev.tcz
gtk3-local.tcz
gtk3mm-dev.tcz
gtk3mm.tcz

Any help will be greatly appreciated.  Thank you...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Getting GTK3 to work with RPi
« Reply #1 on: May 03, 2018, 07:31:05 AM »
If gtk3 and all of its deps are installed correctly, you should see something like this:
Code: [Select]
$ pkg-config --cflags gtk+-3.0
-pthread -I/usr/local/include/gtk-3.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/gtk-3.0 -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/pango-1.0 -I/usr/local/include/fribidi -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng16 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/include/uuid -I/usr/local/include

what do you get?

Note that this should be enough to achieve the above:
Code: [Select]
$ tce-load -i compiletc gtk3-dev

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Re: Getting GTK3 to work with RPi
« Reply #2 on: May 03, 2018, 05:15:03 PM »
Thank you for your reply.  As for what I get when I enter pkg-config --cflags gtk+-3.0:

Package gtk+-3.0 was not found in the pkg-config search path.  Perhaps you should add the directory containing `gtk+-3.0.pc to the PKG_CONFIG_PATH environment variable
No package 'gkt+-3.0 found

When I run tce-load -i compiletc gtk3-dev I get:
compiletc is already installed!
gtk-dev.tcz not found!
which I assuming means that it was already installed and compiled correctly.

I also assume that if everything actually installed correctly that I would not have to add the file to pkg-config.

Could I be missing any other gnu packages or libraries?

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Re: Getting GTK3 to work with RPi
« Reply #3 on: May 03, 2018, 06:18:44 PM »
As for the list you give of files:

If gtk3 and all of its deps are installed correctly, you should see something like this:
Code: [Select]
$ pkg-config --cflags gtk+-3.0
-pthread -I/usr/local/include/gtk-3.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/gtk-3.0 -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/pango-1.0 -I/usr/local/include/fribidi -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng16 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/include/uuid -I/usr/local/include

Many are missing.  I don't have any gtk files in the usr/local/include folder.  I guess I will wipe the card and reinstall everything from scratch.  Thanks again.

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Re: Getting GTK3 to work with RPi
« Reply #4 on: May 03, 2018, 09:11:02 PM »
Update: I reinstalled a clean copy of everything and am now reinstalling all the tcz files.  I finally have gtk-3.0 showing up in my include folder, but pkg-config is now complaining about not having renderproto.pc as required by xrender.  I have both libXrender.tcz and xorg.tcz (with -server, -proto, etc.) installed.  Since this post was from a year ago ( http://forum.tinycorelinux.net/index.php?topic=20693.0 ) do I still need to install the xorg package from the x86 pure core 64 repository to get this working?  Or is it part of another package?

Thank you.
« Last Edit: May 03, 2018, 09:16:35 PM by syntax_error »

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Re: Getting GTK3 to work with RPi
« Reply #5 on: May 03, 2018, 09:12:50 PM »
Sorry for the typo:

Quote
When I run tce-load -i compiletc gtk3-dev I get:
compiletc is already installed!
gtk-dev.tcz not found!
which I assume means that it was not correctly installed and compiled.


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Getting GTK3 to work with RPi
« Reply #6 on: May 04, 2018, 02:02:48 AM »
I finally have gtk-3.0 showing up in my include folder, but pkg-config is now complaining about not having renderproto.pc as required by xrender.

Try replacing the piCore version of xorg-proto with the CorePure64 version from here:

http://www.tinycorelinux.net/9.x/x86_64/tcz/xorg-proto.tcz

..note that you may also need:

http://www.tinycorelinux.net/9.x/x86_64/tcz/xcb-proto.tcz

Offline syntax_error

  • Newbie
  • *
  • Posts: 12
Re: Getting GTK3 to work with RPi
« Reply #7 on: May 04, 2018, 07:19:55 PM »
 Thank you very much for all your help Juanito.  I finally got pkg-config to give me the same output as you had.  Now to get Netbeans working... ::) :D