Re: warnings, errors;source code is included
- From: James Henstridge <james daa com au>
- To: * * <msg124 hotmail com>
- cc: gnome-devel-list gnome org
- Subject: Re: warnings, errors;source code is included
- Date: Mon, 15 Nov 1999 09:11:30 +0800 (WST)
As someone replied to you, this means you have not specified return values
for some of your functions. Specifically, the functions
UpdateProgressTimer and main. If you don't want them to return anything,
use the return type void (so you would use "void main(..." instead of just
"main(...").
James.
--
Email: james@daa.com.au
WWW: http://www.daa.com.au/~james/
On Sun, 14 Nov 1999, * * wrote:
> Hi,
> I am getting warnings and errors like "implicit declarations .. and return
> type defualts to int"
> from the following source code. This ia oneof the examples in "Eric
> Harlow"'s book.
> (by the way very good book). I am new to programming and i have tried
> everything i could.
>
> #include <gtk/gtk.h>
> int ptimer;
> int nValue;
> UpdateProgressTimer (gpointer data)
> {
> nValue += 1;
> UpdatePrgress (nValue, 100);
> if (nValue == 100) {
> EndPorgress ();
> gtk_timeout_remove (ptimer);
> }
> }
> gint ButtonClicked (GtkWidget *widget, gpointer data)
> {
> nValue = 0;
> StartProgress ();
> ptimer = gtk_timeout_add (100, UpdateProgressTimer, data);
> }
> gint CloseAppWindow ()
> {
> gtk_main_quit ();
> return (FALSE);
> }
> main (int argc, char *argv[])
> {
> GtkWidget *window;
> GtkWidget *button;
> gtk_init (&argc, &argv);
> window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title (GTK_WINDOW (window), "Progess bar");
> gtk_signal_connect (GTK_OBJECT (window), "delete_event",
> GTK_SIGNAL_FUNC (CloseAppWindow), NULL);
> button = gtk_button_new_with_label ("Progress bar");
> gtk_widget_show (button);
> gtk_signal_connect (GTK_OBJECT (button) , "clicked",
> GTK_SIGNAL_FUNC (ButtonClicked), NULL);
> gtk_container_add (GTK_CONTAINER (window), button);
> gtk_widget_show (window);
> gtk_main ();
> exit (0);
> }
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
> --
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]