[Solved]Compile gtk-program failed

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Solved]Compile gtk-program failed

Postby janpihlgren » Jan 28th, '18, 08:40

I'm running Mageia 6 with the latest updates
I try to compile the following:
gcc -Wall -lwiringPi -o gtk-led-c gtk-led-c.c `pkg-config --libs --cflags gtk+-2.0`
Beginning of the program as this:
Code: Select all
#include <gtk/gtk.h>

#include <wiringPi.h> 
#include <stdio.h> 
#include <stdlib.h> 

  int i=0;
 
void print_msg(GtkWidget *widget, gpointer window) {
......

and get tfollowing error:
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
gtk-led-c.c:8:21: ödesdigert fel: gtk/gtk.h: Filen eller katalogen finns inte
kompilering avslutad.

The program compiles nicely in Raspbian (a Debian linux-distribution for Raspberry Pi)

I have searched for gtk-devel of som kind but couldn't fined any corresponding packages.
Are there anyone that know what to do?
Last edited by janpihlgren on Jan 30th, '18, 08:29, edited 2 times in total.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: Compilen gtk-program failed

Postby doktor5000 » Jan 28th, '18, 16:50

janpihlgren wrote:I have searched for gtk-devel of som kind but couldn't fined any corresponding packages.


How did you search in particular?
Code: Select all
urpmf -f --name gtk | grep devel
should show quite a few packages.

urpmi gtk2-devel will install it.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Compilen gtk-program failed

Postby janpihlgren » Jan 29th, '18, 07:11

I used mcc and search for gtk and gtk****devel
and couldn't find anything

Your sugestion give this result:
Code: Select all
[jan@Humlan ~]$ urpmf -f --name gtk | grep gtk devel
grep: devel: Fie or direktory does not exist
[jan@Humlan ~]$
Last edited by isadora on Jan 29th, '18, 12:39, edited 2 times in total.
Reason: Placed command-output in between [CODE]-tags for better readability ;)
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: Compilen gtk-program failed

Postby wintpe » Jan 29th, '18, 16:50

it would help if you followed doktors example,

to grep for multiple things at once you need to use egrep syntax.

grep syntax only takes one argument


egrep syntax is as follows

grep -E 'gtk|devel'

but im not sure looking at it that is what you wanted to do anyway.

grep gtk-devel might have worked

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Compilen gtk-program failed

Postby doktor5000 » Jan 29th, '18, 19:29

janpihlgren wrote:Your sugestion give this result:
Code: Select all
[jan@Humlan ~]$ urpmf -f --name gtk | grep gtk devel
grep: devel: Fie or direktory does not exist
[jan@Humlan ~]$


No, my suggestion would have given a different result, check your command. It also makes no sense to search for a package with urpmf that has "gtk" in it's name and then filter the output again for "gtk" with grep.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Compilen gtk-program failed

Postby janpihlgren » Jan 30th, '18, 06:51

OK. Here is a new try:
Code: Select all
lib64indicate-gtk-devel-12.10.1-2.mga6.x86_64
gtk-sharp-beans-devel-2.13.92-0.6.mga6.noarch
ruby-gtk2-devel-3.0.7-2.mga6.x86_64
lib64inftgtk-devel-0.6.7-2.mga6.x86_64
lib64inftextgtk-devel-0.6.7-2.mga6.x86_64
lib64gtksourceview-2.0-devel-2.11.2-11.mga6.x86_64
lib64gtkhtml2-devel-2.11.1-15.mga6.x86_64
lib64gtkhotkey-devel-0.2.1-7.mga6.x86_64
lib64gtkgl-devel-2.0.1-9.mga6.x86_64
lib64gtkhtml-3.14-devel-3.32.2-8.mga6.x86_64
lib64gtksourceview-1.0-devel-1.8.5-13.mga6.x86_64
lib64aiksaurusgtk-devel-1.2.1-15.mga6.x86_64
lib64gtkdatabox-devel-0.9.2.0-4.mga6.x86_64
lib64gtkspell-devel-2.0.16-11.mga6.x86_64
lib64gtkimageview-devel-1.6.4-9.mga6.x86_64
lib64unicapgtk-devel-0.9.8-7.mga6.x86_64
lib64colord-gtk-devel-0.1.26-2.mga6.x86_64
lib64ggz-gtk-client-devel-0.99.5-2.mga6.x86_64
lib64gtkglextmm-devel-1.2.0-9.mga6.x86_64
lib64gtkhtml4.0-devel-4.10.0-2.mga6.x86_64
lib64gtkmathview-devel-0.8.0-15.mga6.x86_64
lib64mx-gtk1.0-devel-1.4.7-15.mga6.x86_64
lib64girara-gtk3-devel-0.2.6-1.mga6.x86_64
gtk-sharp3-devel-2.99.3-6.mga6.x86_64
python-gtksourceview-devel-2.10.1-13.mga6.x86_64
lib64cxx-gtk-utils2.2-devel-2.2.13-3.mga6.x86_64
lib64avahi-ui-gtk3-devel-0.6.32-1.mga6.x86_64
pygtk2.0-devel-2.24.0-11.mga6.x86_64
lib64gtkmm2.4-static-devel-2.24.5-1.mga6.x86_64
ocaml-lablgtk2-devel-2.18.3-2.mga6.x86_64
lib64clutter-gtk-devel-1.8.2-2.mga6.x86_64
gtk-sharp2-devel-2.12.26-3.mga6.x86_64
lib64gtkpod-devel-2.1.5-4.mga6.x86_64
lib64gtkmm2.4-devel-2.24.5-1.mga6.x86_64
lib64yui-gtk-devel-2.44.7-1.mga6.x86_64
lib64yui-mga-gtk-devel-1.0.2-3.mga6.x86_64
lib64gtkhex-devel-3.18.3-1.mga6.x86_64
lib64gtksourceviewmm3.0-devel-3.21.3-1.mga6.x86_64
ocaml-ocamlnet-gtk2-devel-3.7.7-3.mga6.x86_64
lib64spice-gtk-devel-0.33-3.mga6.x86_64
lib64gtk-vnc2.0-devel-0.6.0-3.mga6.x86_64
lib64gtk-vnc1.0-devel-0.6.0-3.mga6.x86_64
lib64wxgtku2.8-devel-2.8.12-19.mga6.x86_64
lib64canberra-gtk-devel-0.30-11.mga6.x86_64
lib64canberra-gtk3-devel-0.30-11.mga6.x86_64
lib64champlain-gtk-devel-0.12.15-1.mga6.x86_64
lib64dbusmenu-gtk2-devel-16.04.1-1.20170109.1.mga6.x86_64
lib64dbusmenu-gtk3-devel-16.04.1-1.20170109.1.mga6.x86_64
lib64gtkspell3-devel-3.0.9-3.mga6.x86_64
lib64webkitgtk3.0-devel-2.4.10-3.mga6.x86_64
lib64webkitgtk1.0-devel-2.4.10-3.mga6.x86_64
lib64gtkextra-x11-devel-3.3.3-1.mga6.x86_64
lib64gtkmm3.0-static-devel-3.22.0-1.mga6.x86_64
lib64gtkmm3.0-devel-3.22.0-1.mga6.x86_64
lib64cheese-gtk-devel-3.24.0-1.mga6.x86_64
lib64polkit-gtk-mate-devel-1.18.1-1.mga6.x86_64
lib64gtksourceview3.0-devel-3.24.2-1.mga6.x86_64
lib64wxgtku3.0-devel-3.0.3.1-1.mga6.x86_64
lib64gtkglext-devel-1.2.0-21.mga6.x86_64
lib64nm-gtk-devel-1.8.2-1.mga6.x86_64
lib64gtk+3.0-devel-3.22.16-1.mga6.x86_64
lib64gtk+2.0-devel-2.24.31-3.mga6.x86_64
lib64gtkpod-devel-2.1.5-4.mga6.tainted.x86_64
libgtkhtml4.0-devel-4.10.0-2.mga6.i586
libggz-gtk-client-devel-0.99.5-2.mga6.i586
python-gtksourceview-devel-2.10.1-13.mga6.i586
pygtk2.0-devel-2.24.0-11.mga6.i586
libaiksaurusgtk-devel-1.2.1-15.mga6.i586
libgtkhtml-3.14-devel-3.32.2-8.mga6.i586
libgtksourceview-2.0-devel-2.11.2-11.mga6.i586
gtk-sharp-beans-devel-2.13.92-0.6.mga6.noarch
libgtkhtml2-devel-2.11.1-15.mga6.i586
libgtkhotkey-devel-0.2.1-7.mga6.i586
libgtksourceview-1.0-devel-1.8.5-13.mga6.i586
libgtkpod-devel-2.1.5-4.mga6.i586
libinftextgtk-devel-0.6.7-2.mga6.i586
libgirara-gtk3-devel-0.2.6-1.mga6.i586
libcxx-gtk-utils2.2-devel-2.2.13-3.mga6.i586
libgtkimageview-devel-1.6.4-9.mga6.i586
libindicate-gtk-devel-12.10.1-2.mga6.i586
libunicapgtk-devel-0.9.8-7.mga6.i586
libgtkdatabox-devel-0.9.2.0-4.mga6.i586
libcolord-gtk-devel-0.1.26-2.mga6.i586
libgtkglextmm-devel-1.2.0-9.mga6.i586
ruby-gtk2-devel-3.0.7-2.mga6.i586
libmx-gtk1.0-devel-1.4.7-15.mga6.i586
libgtkspell-devel-2.0.16-11.mga6.i586
libgtkmathview-devel-0.8.0-15.mga6.i586
gtk-sharp2-devel-2.12.26-3.mga6.i586
libavahi-ui-gtk3-devel-0.6.32-1.mga6.i586
libinftgtk-devel-0.6.7-2.mga6.i586
libgtkgl-devel-2.0.1-9.mga6.i586
gtk-sharp3-devel-2.99.3-6.mga6.i586
libgtkmm2.4-devel-2.24.5-1.mga6.i586
libgtkmm2.4-static-devel-2.24.5-1.mga6.i586
ocaml-lablgtk2-devel-2.18.3-2.mga6.i586
libclutter-gtk-devel-1.8.2-2.mga6.i586
libyui-gtk-devel-2.44.7-1.mga6.i586
libyui-mga-gtk-devel-1.0.2-3.mga6.i586
libgtkhex-devel-3.18.3-1.mga6.i586
libgtksourceviewmm3.0-devel-3.21.3-1.mga6.i586
ocaml-ocamlnet-gtk2-devel-3.7.7-3.mga6.i586
libspice-gtk-devel-0.33-3.mga6.i586
libgtk-vnc2.0-devel-0.6.0-3.mga6.i586
libgtk-vnc1.0-devel-0.6.0-3.mga6.i586
libwxgtku2.8-devel-2.8.12-19.mga6.i586
libcanberra-gtk3-devel-0.30-11.mga6.i586
libcanberra-gtk-devel-0.30-11.mga6.i586
libchamplain-gtk-devel-0.12.15-1.mga6.i586
libdbusmenu-gtk3-devel-16.04.1-1.20170109.1.mga6.i586
libdbusmenu-gtk2-devel-16.04.1-1.20170109.1.mga6.i586
libgtkspell3-devel-3.0.9-3.mga6.i586
libwebkitgtk1.0-devel-2.4.10-3.mga6.i586
libwebkitgtk3.0-devel-2.4.10-3.mga6.i586
libgtkextra-x11-devel-3.3.3-1.mga6.i586
libcheese-gtk-devel-3.24.0-1.mga6.i586
libgtkmm3.0-devel-3.22.0-1.mga6.i586
libgtkmm3.0-static-devel-3.22.0-1.mga6.i586
libpolkit-gtk-mate-devel-1.18.1-1.mga6.i586
libgtksourceview3.0-devel-3.24.2-1.mga6.i586
libwxgtku3.0-devel-3.0.3.1-1.mga6.i586
libgtkglext-devel-1.2.0-21.mga6.i586
libnm-gtk-devel-1.8.2-1.mga6.i586
libgtk+3.0-devel-3.22.16-1.mga6.i586
libgtk+2.0-devel-2.24.31-3.mga6.i586
libgtkpod-devel-2.1.5-4.mga6.tainted.i586


What's gtk-sharp ?
Last edited by isadora on Jan 30th, '18, 12:35, edited 1 time in total.
Reason: Placed command-output in between [CODE]-tags for better readability ;)
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: [Solved]Compilen gtk-program failed

Postby janpihlgren » Jan 30th, '18, 08:29

I solved the problem.
I installed lib64gtk+2.0-devel and lib64gtk+3-devel
I also checked that lib64gtk-2.0_0 and lib64gtk-3_0
After that I could compile the program.

Thanks for help.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron