GTK programming
Ok after checking out ncurses and xlib im trying to figure out what im doing
wrong here. The tutorial im reading wants to create a basic program that creates a window. here is the code. Code:
#include <gtk/gtk.h> and i have gtk-1.2 and 2.0 installed i get the compiler error GtkWidget undefined and GTK_WINDOW_TOPLEVEL undefined. shouldent these be defined in the header file ??? |
hmm, yeah it should be included... does "gtk-config --libs --cflags" present the right details though? Maybe that's a gtk-1.4 thing?
But really... can i just suggest that you don't bother? instead use gtk2 instead.. why bother learning a deprecated library that is no longer supported? |
Hmm i thought this was gtk 2.0 programming model.
know of any tutorials that have the updated 2.0 stuff ?? C language of course not C++ |
gtk.org for everything really... i forget the code differences between the two, so maybe that IS gtk2 code, BUT you are definitely linking on gtk1 libraries. gtk1 uses the gtk-config gubbins, whilst gtk2 uses the mroe complete pkg-config framework for getting libs and cflag values.
|
Try replacing your compile command:
gcc -o test main.c 'gtk-config --cflags --libs' with this one: gcc -o test main.c `pkg-config --cflags --libs gtk+-2.0` Notice the different quote marks around the last half of the command, that may be part of your problem. |
I would suggest you use an IDE for developing large GUI applications.
Much easier and saves quite a bit of trouble compiling. Anjuta is a good IDE for GTK and Gnome development while KDevelop is also a very good general purpose IDE. |
Yea that was the issue it was the ` ohh on the gtk+-2.0 page the latest one is not there its supposed to be but its not. I installed that and now am trying to solve another issue with compiling a simple hello world program keeps giving me a parse error but i see no error with the syntax. ??
here is the line gcc is not likeing Code:
static gboolean delete_event (GtkWidget *widget, GtkEvent *event , gpointer data) It looks fine to me for a function im not familliar with gboolean tho is that the issue? |
I think you shoulda copied and pasted it instead of retyping..! it's GdkEvent, not a GtkEvent.
|
Ok somehow by removeing my /* */ to track the issue im no longer getting a syntax error but another has occured here let me just post the whole code.
Code:
#include <gtk/gtk.h> im double checking my code to see if I copied something wrong. but if you find it here before I do then cool. ohh here is what im copying http://www.gtk.org/tutorial/ch-getti...SEC-HELLOWORLD |
Never mind i found it.
lol helps if i spell signal correctly. |
Cool well Im experimenting more and more with gtk+-2.0 im starting to see why programmers like this interface for creating gui apps. Its much eazier to figure out then xlib or ncurses. Maybe its just me tho , but its something at least i can understand why this is here and why thats there in the programming code.
|
All times are GMT -5. The time now is 12:53 AM. |