Re: Problem compiling GTK+ and GLib 1.2.5




Tony Denault <denault@hawaii.edu> writes:

> gtk 1.2.5 didn't compile on my linux system: slackware, 2.2.6 kernal, gcc  2.7.2.3
> The problem as in testgtk.c, the line
>    static int idle = 0; (line 7771)
> conflicted with a line in /usr/include/unistd.h:669: extern int  idle __P((void));
> See output below:
> 
>    gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"Gtk\" -DGTK_DISABLE_COMPAT_H
>    -DGTK_EXE_PREFIX=\"/usr/local\" -DGTK_DATA_PREFIX=\"/usr/local\" -DGTK_SYSCONFDIR=\"/usr/local/etc\"
>    -DGTK_LOCALEDIR=\"/usr/local/lib/locale\" -I.. -DGTK_NO_CHECK_CASTS -DUSE_XIM
>    -I/usr/local/lib/glib/include -I/usr/local/include -D_REENTRANT -I/usr/X11R6/include    -O2 -Wall -c
>    testgtk.c
>    testgtk.c:7771: `idle' redeclared as different kind of symbol
>    /usr/include/unistd.h:669: previous declaration of `idle'
>    testgtk.c:7771: warning: `idle' was declared `extern' and later `static'
>    make[2]: *** [testgtk.o] Error 1
> 
> Just renamed the idle variable & everything was ok.

This is egregious namespace pollution on the part of your obsolete C
library.  idle() is not a standard system function name and <unistd.h>
should not be defining it. (Look at the manpage for more information
on what idle() is.)

Will be renamed 1.2.6. <sigh>

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]