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

Re: problem with <unistd.h>



found the answer to this one: lose the "-ansi" flag under the compile flags


Kevin Wooley wrote:
> 
> I'm trying to compile with the function  usleep(...), which is part of standard
> part of <unistd.h> on most linux installations.
> 
> I'm just using a generic makefile, here's what the output is when I type make:
> 
>  g++-cris  -isystem /usr/tmp/axis/devboard_82/target/cris-axis-linux-gnu/include
> -mlinux -Wall -Wshadow -O2 -g -Wno-ctor-dtor-privacy -ansi -pipe   -c -o
> app_1_1.o app_1_1.C
> app_1_1.C: In function `int main ()':
> app_1_1.C:298: implicit declaration of function `int usleep (...)'
> app_1_1.C: In function `void SendFrameData (int, MotionTracker *)':
> app_1_1.C:355: warning: assignment to `short int' from `double'
> app_1_1.C:355: warning: argument to `short int' from `double'
> app_1_1.C:316: warning: unused variable `short int retVal'
> make: *** [app_1_1.o] Error 1
> 
> any idea why I can't find the function.  I thought maybe it was using the wrong
> version of unistd.h
> 
> thanks,
> 
>         Kevin