LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-17-2005, 09:40 AM   #1
asahlot
Member
 
Registered: Sep 2005
Location: india
Distribution: Fedora Core 2
Posts: 62

Rep: Reputation: 15
how to debug GTK+ program


Hello all,
How are you doing? I am new to GTK+ programming and dont know how to debug any program written in GTK+. Some body please help me out in this regard. I compile the program with command.
#gcc -Wall source.c -o outfile `gtk-config --cflags --libs`
Is there some other way to compile the same program?
Thanx in advance.
Regards,
 
Old 10-17-2005, 10:08 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
what kind of debugging are you after? the standard gnu debugger, gdb will help you identify and major faults in the compiled code, other than that, add printf's to help you step through what you're doing.

please note that gtk+ is OLD and DEPRECATED now. you should NOT start learning it now. instead, learn gtk2, which is subtantially more flexible, with a notably nicer API to develop with.
 
Old 10-17-2005, 02:13 PM   #3
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. As acid_kewpie points out, you should be using GTK+ 2.0/GDK, not the older GTK+ 1.0 library. I presume you're already doing so.

2. In addition to the standard debugging tools (gdb, "printf", etc etc), GTK+ 2.0 also has some nice built-in capabilities, notiably
using the GDK_DEBUG environment variable and the gdk-debug compiler flag:

http://www.gtk.org/api/2.6/gtk/gtk-running.html

'Hope that helps .. PSM
 
Old 10-17-2005, 02:26 PM   #4
asahlot
Member
 
Registered: Sep 2005
Location: india
Distribution: Fedora Core 2
Posts: 62

Original Poster
Rep: Reputation: 15
Hi paulsm4..
You are right that I am using GTK 2.0...
Thanx to light up my way.. I got the point now..
Regards..
 
Old 10-19-2005, 04:23 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
if you're using gtk2, then you wouldn't be using "gtk-config". gtk2 has never used this script, but uses pkgconfig frameworks instead.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do i debug my c++ program please? twirl Programming 1 09-12-2005 02:34 AM
how can I debug the interactinve program with GDB bigapple Programming 1 08-03-2005 09:55 PM
Can someone debug this 4 line program? (C) Squall Programming 3 03-22-2004 10:48 PM
How do I debug a C program mfeoli Programming 3 03-12-2004 01:58 PM
c++ newbie - help debug simple program please mymojo Programming 4 11-27-2003 04:17 AM


All times are GMT -5. The time now is 07:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration