LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-06-2006, 06:42 AM   #1
b123coder
Member
 
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
GTK version problem


Hi,
What is the GTK version provided on FC5 ?? How can i test which gtk i have 1.2 or 2?? and whats difference between gtk-config and pkg-config? and which is to be used with which GTK version to compile a GTK program?
 
Old 04-06-2006, 06:45 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you will have BOTH versions. they are seperate libraries and happily coexist together. gtk-config is for gtk whilst gtk2 uses the generic pkg-config framework.
 
Old 04-06-2006, 07:10 AM   #3
b123coder
Member
 
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Original Poster
Rep: Reputation: 15
hi,
thanks for answer. but i am not understanding why both versions are given?? and why pkg-config is not working??
i mean on FC5 when i gave
Quote:
gcc -c test.c `gtk-config --cflags --libs` -o test
worked
but
Quote:
gcc -c test.c `pkg-config --cflags --libs` -o test
not working why??
 
Old 04-06-2006, 07:39 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Not sure about gtk-config as I've never used it, but you need to specify the library to link with pkg-config, e.g.

$ gcc test.c -otest `pkg-config --cflags --libs gtk+-2.0`.
 
Old 04-06-2006, 08:35 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you either have gtk applications or you have gtk2 applications, they are seperate libraries, seperate API's. you can consider them as totally different things. you can not choose wether you compile an application with gtk or gtk2 just as you can not choose to use qt instead on a whim.

and of course you are using pkgconfig wrongly...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GIMP Toolkit - Glib/GTK+ Version Problem lucky6969b Programming 1 01-05-2006 05:16 PM
removing old version of gtk Matt.Ramos Linux - Newbie 1 07-24-2005 01:21 AM
How to remove old version of GTK? JakeMH Linux - Software 7 05-22-2005 09:49 AM
GTK version troubles gokul Linux - Newbie 2 11-30-2004 11:56 PM
Problem after uninstalling GTK+ to install newer version rockymtns99 Linux - Software 0 05-24-2004 11:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration