8 years, 6 months ago.  This question has been closed. Reason: Duplicate question

conflicting declaration of C function 'sleep'

My dear fellows,

I've just begun developing for Ublox' C027 board (with a Cortex-M3 based NXP LPC1768) and, for that purpose, have successfully set up Eclipse Luna 4.4.2 on Windows 7x64 with the recent GNU ARM Eclipse plugins and toolchain as kindly provided by Liviu Ionescu.

I can create and compile a 'Hello World ARM Cortex-M C/C++ Project' without problems, but as soon as I add the mbed libraries, compilation fails with the following error message:

error message

conflicting declaration of C function 'unsigned int sleep(unsigned int)':
line 188, external location: c:\program files (x86)\gnu tools arm embedded\4.9 2015q3\arm-none-eabi\include\sys\unistd.h	

previous declaration 'void sleep()'	sleep_api.h	/mbed/libraries/mbed/hal	line 41

unistd.h is included via the file /system/include/diag/trace.h from Eclipse's template. The mentioned functions headers:

sys/unistd.h sleep

unsigned _EXFUN(sleep, (unsigned int __seconds ));

mbed/hal/sleep_api.h

void sleep(void);

Do you have a hint how to solve that issue, or maybe how to work around it? I'd be glad about any suggestion - thank you in advance!