[qvwm-e:00319] Re: usleep ERROR - compiling on DEC-alpha

Chris Sorenson <[email protected]> Wed, 05 Mar 2003 00:14:41 -0600
Newsgroups gmane.comp.window-managers.qvwm.english
Organization =^..^=
Message-ID <[email protected]>
>
>
>Thank your for the suggestion which seems to be going in the right direction.
>Sorry I forget to mention the OS it is DEC-OSF4 not a Linux, I believe that
>this has an old clib.
>
>There is some usleep in unistd.h and it seems to be only there, but the file
>is from 1989.
>
>The relevant part is:
>
>#ifdef _XOPEN_SOURCE_EXTENDED                                                                   
>extern int usleep __((useconds_t ));    /* spec1170 requires a value to be returned */          
>#else                                                                                           
>                                                                                                
>#ifndef _XOPEN_SOURCE                                                                           
>extern void usleep __((unsigned int));                                                          
>#endif  /* _XOPEN_SOURCE */                                                                     
>                                                                                                
>#endif /* _XOPEN_SOURCE_EXTENDED */                                                             
>    
>
>However, via the Makefile the /usr/include is not included:
>                               
> c++ -DQVWMDIR=\"/project/amphioxus/share/qvwm\" -DIMGDIR=\"/project/amphioxus/share/qvwm/images\" -DSNDDIR=\"/project/amphioxus/share/qvwm/sounds\" -DPATH_RM=\"/usr/ucb/rm\" -DHAVE_CONFIG_H -I.. -I. -g -O2 -I/usr/local/include  -fpermissive -c titlebar.cc
>
>includeing it via:
> c++ -DQVWMDIR=\"/project/amphioxus/share/qvwm\"
> -DIMGDIR=\"/project/amphioxus/share/qvwm/images\"
> -DSNDDIR=\"/project/amphioxus/share/qvwm/sounds\" -DPATH_RM=\"/usr/ucb/rm\"
> -DHAVE_CONFIG_H -I.. -I. -g -O2 -I/usr/local/include  -I/usr/include  -fpermissive -c titlebar.cc
>
>also does not help, I get a lot of X11-errors now, and usleep is still not
>defined. Still a suggestion ?
>
>  
>
The version of unistd.h on my computer (from GNU's glibc 2.2.5 ) agrees 
with yours that defining _XOPEN_SOURCE_EXTENDED will activate the 
necessary function prototype of the usleep() function.

So, if you add a line:

#define _XOPEN_SOURCE_EXTENDED

to the qvwm file acconfig.h, and then rerun ./configure, and then make, 
it might solve your problem.

You shouldn't need to force -I/usr/include, the compiler knows to look 
in /usr/include by default. I'm not sure why doing so would cause X 
errors though...