Re: undefined reference to `_legacy_sleep'


Nashif, Anas
 

You should not include legacy.h directly, just include zephyr.h

 

legacy.h will be dropped for 1.8 and you should be using new APIs, not a legacy API like task_sleep.

 

 

Anas

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of kk
Sent: Wednesday, March 29, 2017 12:34 PM
To: zephyr-devel@...
Subject: [Zephyr-devel] undefined reference to `_legacy_sleep'

 

Hi all

When I use the "task_sleep" function, I include the file legacy.h, but the compiler tells:
    undefined reference to `_legacy_sleep'

I search the source code in zephyr, its definition in ./kernel/legacy_timer.c, how can I solve this problem?

Thanks

Join devel@lists.zephyrproject.org to automatically receive all group messages.