LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to debug GTK+ program (https://www.linuxquestions.org/questions/programming-9/how-to-debug-gtk-program-373929/)

asahlot 10-17-2005 09:40 AM

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,

acid_kewpie 10-17-2005 10:08 AM

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.

paulsm4 10-17-2005 02:13 PM

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

asahlot 10-17-2005 02:26 PM

Hi paulsm4..
You are right that I am using GTK 2.0...
Thanx to light up my way.. I got the point now..
Regards..

acid_kewpie 10-19-2005 04:23 AM

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


All times are GMT -5. The time now is 05:08 AM.