carndacier
carndacier

Reputation: 960

contiki-z1-main.c : "undefined reference to 'autostart_processes'"

When I try to compile a .c file with Cooja, Contiki, there are these errors:

 contiki-z1-main.c(.init9+0x200): undefined reference to `autostart_processes`
 contiki-z1-main.c(.init9+0x224): undefined reference to `autostart_processes`

Does anyone know the issue?

Upvotes: 0

Views: 2021

Answers (2)

leo
leo

Reputation: 41

Becasuse of that the "AUTOSTART_PROCESSES" is defined not correctly.

In file "autostart.h",you could find the code there:

#if AUTOSTART_ENABLE
#define AUTOSTART_PROCESSES(...)                    \
struct process * const autostart_processes[] = {__VA_ARGS__, NULL}
#else /* AUTOSTART_ENABLE */
#define AUTOSTART_PROCESSES(...)                    \
extern int _dummy

So if you dont't define "AUTOSTART_ENABLE" as 1, the autostart function won't work, and your process will not start.

Upvotes: 0

msloth
msloth

Reputation: 56

You haven't defined the AUTOSTART_PROCESSES(), so Contiki does not know where to start executing your application.

For eg Blink,

PROCESS(blink_process, "Blink example");
AUTOSTART_PROCESSES(&blink_process);

Upvotes: 1

Related Questions