8 years, 6 months ago.

Conflicting declaration of C function 'void sleep()'

Quite similar to existing topic https://developer.mbed.org/forum/bugs-suggestions/topic/17173/ but different in that the source of the error strangely seems to be coming from the mbed lib itself:

[Error] sleep_api.h@44,6: conflicting declaration of C function 'void sleep()'
[ERROR] In file included from ./lib/mbed-os/mbed.h:94:0,
                 from ./lib/mbed-os/events/EventQueue.cpp:19:
./lib/mbed-os/hal/sleep_api.h:44:6: error: conflicting declaration of C function 'void sleep()'
 void sleep(void);
      ^~~~~
In file included from /usr/arm-none-eabi/include/string.h:10:0,
                 from ./lib/mbed-os/platform/Callback.h:19,
                 from ./lib/mbed-os/events/EventQueue.h:21,
                 from ./lib/mbed-os/events/EventQueue.cpp:16:
/usr/arm-none-eabi/include/sys/unistd.h:209:10: note: previous declaration 'unsigned int sleep(unsigned int)'
 unsigned _EXFUN(sleep, (unsigned int __seconds ));
          ^

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /home/malachi/Projects/playground/playground.boost/src/mbed5/.temp/tools/make.py -t GCC_ARM -m NUCLEO_F401RE --source . --build ./BUILD/NUCLEO_F401RE/GCC_ARM" in "/home/malachi/Projects/playground/playground.boost/src/mbed5"

Some info about my environment: I'm experimenting with some libs which *might* yank in unistd , but should be #ifdef'd out... hopefully

Even if that's an issue, would the error look like what we're seeing here?

Be the first to answer this question.