![]() |
|
,
0 Comments
)
|
| Subject:
How to compile a gnome program
Category: Computers > Programming Asked by: ga1000-ga List Price: $10.00 |
Posted:
26 Apr 2003 22:06 PDT
Expires: 26 May 2003 22:06 PDT Question ID: 196051 |
I tried to compile the following sample tutorial code on Red Hat 8.0, with
>gcc test.c -o test1 `gnome-config --cflags --libs gnomeui`
The output is an error message "undefined reference to gtk_Widget_show".
Please advice how to solve this problem in order to produce an empty window.
I assume that RH 8.0 has all the gnome libraries.
sample code is :
#include <gnome.h>
int main (int argc, char *argv[])
{
GtkWidget *app;
gnome_init("example","0.1",argc, argv);
app=gnome_app_new("example","Window Title");
gtk_Widget_show(app);
gtk_main();
return 0;
} |
|
| Subject:
Re: How to compile a gnome program
Answered By: eiffel-ga on 26 Apr 2003 22:49 PDT Rated: ![]() |
Hi ga1000-ga, Identifier names are case-sensitive in the C programming language, and your error message is caused by a spurious uppercase letter. If you change 'gtk_Widget_show' to 'gtk_widget_show' then your example should work. I tried it on my RedHat 8.0 system and it produced an empty window, as expected. Note that you are not calling 'gtk_main_quit' in your example code. If you launch your compiled example from the command-line (for example by typing './test' in a console window) you will probably have to press control-C to regain the command prompt (even after you have closed the window of the example application). For a more complete introductory example including a clean shutdown see "Hello World in GTK": http://www.gtk.org/tutorial/ch-gettingstarted.html#SEC-HELLOWORLD The 'gtk_widget_show' identifier is defined in file 'gtkwidget.c', according to the Gnome Cross Reference search http://cvs.gnome.org/lxr/ident?i=gtk_widget_show which provides a handy way to find usage examples for any GTK identifier. Google search strategy: gtk_Widget_show ://www.google.com/search?q=gtk_Widget_show gtk tutorial ://www.google.com/search?q=gtk%20tutorial Regards, eiffel-ga | |
| |
| |
ga1000-ga
rated this answer:
|
|
| There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |