| PLEX86 | ||
|
Compilation ProblemHello I have redhat linux 9.1 I have installed Gnome Development Kit which is there in the distribution CDs. I am trying to compile following file. But I am facing some problem with it. I have tried almost every GCC option that I know. For example,First it was giving error as gtk.h not found. So I used -I option to specify the directory which contains gtk.h Later someone told me to give the comman as gcc -Wall -g window.c -o window `gtk-config --cflags` `gtk-config --libs` But it didnot solve the problem also. But instead of removing the errors,it generated too many errors to count. Please help me out as soon as possible. Thank you Proclama del Comandante en Jefe Fidel Castro al pueblo de Cuba Con motivo del enorme esfuerzo realizado para visitar la ciudad argentina de C—rdoba, participar en la Reuni—n del MERCOSUR... * *File name: hbox.c *
*-- This function allows the program to exit properly when the window is closed --*gint destroyapp (GtkWidget *widget, gpointer gdata) { gprint ("Quitting...-n"); gtkmainquit(); return (FALSE);
} *-- This function responds to the mouse click on the button --*void buttonclicked(GtkWidget *widget, gpointer gdata) { gprint("Button was clicked.-n"); } int main (int argc, char *argv) { *-- Declare the GTK Widgets used in the program --* GtkWidget *window; GtkWidget *label1; GtkWidget *label2; GtkWidget *label3; GtkWidget *button1; GtkWidget *button2; GtkWidget *button3; GtkWidget *hbox; *-- Initialize GTK --* gtkinit (&argc, &argv); *-- Create the new window --* window = gtkwindownew(GTKWINDOWTOPLEVEL); *-- Create the labels --* label1 = gtklabelnew("Label1"); label2 = gtklabelnew("Label2"); label3 = gtklabelnew("Label3"); *-- Create some buttons to fill the vbox with --* button1 = gtkbuttonnewwithlabel("Button 1"); button2 = gtkbuttonnewwithlabel("Button 2"); button3 = gtkbuttonnewwithlabel("Button 3"); *-- Create the hbox --* hbox = gtkhboxnew(FALSE,0); *-- Connect the window to the destroyapp function --* gtksignalconnect(GTKOBJECT(window), "deleteevent", GTKSIGNALFUNC(destroyapp), NULL); *-- Connect all the buttons to the buttonwasclicked function --* gtksignalconnect(GTKOBJECT(button1), "clicked", GTKSIGNALFUNC(buttonclicked), NULL); gtksignalconnect(GTKOBJECT(button2), "clicked", GTKSIGNALFUNC(buttonclicked), NULL); gtksignalconnect(GTKOBJECT(button3), "clicked", GTKSIGNALFUNC(buttonclicked), NULL); *-- Add all the buttons to the vbox --* gtkboxpackstart(GTKBOX(hbox), label1, FALSE, FALSE, 2); gtkboxpackstart(GTKBOX(hbox), button1, FALSE, FALSE, 2); gtkboxpackstart(GTKBOX(hbox), label2, FALSE, FALSE, 2); gtkboxpackstart(GTKBOX(hbox), button2, FALSE, FALSE, 2); gtkboxpackstart(GTKBOX(hbox), label3, FALSE, FALSE, 2); gtkboxpackstart(GTKBOX(hbox), button3, FALSE, FALSE, 2); *-- Add the button to the window --* gtkcontaineradd(GTKCONTAINER (window), hbox); *-- Add a border to the window to give the buttons a little room --* gtkcontainerborderwidth (GTKCONTAINER (window), 15); *-- Display the widgets --* gtkwidgetshow(hbox); gtkwidgetshow(label1); gtkwidgetshow(label2); gtkwidgetshow(label3); gtkwidgetshow(button1); gtkwidgetshow(button2); gtkwidgetshow(button3); gtkwidgetshow(window); *-- Start the GTK event loop --* gtkmain(); Minimum space for DVD project Some one recently complain that Linux is not - because his project has taken too much space. Person who was complaining has... *-- Return 0 if exit is successful --* return 0;
}
There is yet another file,with which I am facing some problem,I am giving that file as well.
* *File name: window.c gcc -Wall -g window.c -o window `gtk-config --cflags` `gtk-config --libs` *
int main (int argc, char *argv) { *-- Declare the GTK Widgets used in the program --* GtkWidget *window; *-- Initialize GTK --* gtkinit (&argc, &argv); *-- Create the new window --* window = gtkwindownew(GTKWINDOWTOPLEVEL); *-- Display the window --* gtkwidgetshow(window); *-- Start the GTK event loop --* gtkmain(); *-- Return 0 if exit is successful --* return 0;
}
|
||||
Linux groups from Newsgroups The #1 Usenet Provider on the Internet
More Linux Slopware. I can't believe you guys use this crap. 1958 |
||||