Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By tiestvangool
#34070 Hi experts,

I am looking for some help as I am unable to build my firmware file(s) for the Blinky example.
When running the script as outlined in the esp8266-wiki/wiki/Building section, I get the following error: "implicit declaration of function".

Code: Select all(trusty)tiestvangool@localhost:~$ ./blinky.sh
Cloning into 'source-code-examples'...
remote: Counting objects: 107, done.
remote: Total 107 (delta 0), reused 0 (delta 0), pack-reused 107
Receiving objects: 100% (107/107), 20.63 KiB | 0 bytes/s, done.
Resolving deltas: 100% (28/28), done.
Checking connectivity... done.
CC user/user_main.c
In file included from user/user_main.c:2:0:
user/user_main.c: In function 'user_procTask':
/opt/Espressif/ESP8266_SDK/include/osapi.h:12:21: error: implicit declaration of function 'ets_delay_us' [-Werror=implicit-function-declaration]
 #define os_delay_us ets_delay_us
                     ^
user/user_main.c:34:5: note: in expansion of macro 'os_delay_us'
     os_delay_us(10);
     ^
user/user_main.c: In function 'user_init':
/opt/Espressif/ESP8266_SDK/include/osapi.h:31:25: error: implicit declaration of function 'ets_timer_disarm' [-Werror=implicit-function-declaration]
 #define os_timer_disarm ets_timer_disarm
                         ^
user/user_main.c:51:5: note: in expansion of macro 'os_timer_disarm'
     os_timer_disarm(&some_timer);
     ^
/opt/Espressif/ESP8266_SDK/include/osapi.h:32:24: error: implicit declaration of function 'ets_timer_setfn' [-Werror=implicit-function-declaration]
 #define os_timer_setfn ets_timer_setfn
                        ^
user/user_main.c:54:5: note: in expansion of macro 'os_timer_setfn'
     os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
     ^
/opt/Espressif/ESP8266_SDK/include/osapi.h:30:31: error: implicit declaration of function 'ets_timer_arm_new' [-Werror=implicit-function-declaration]
 #define os_timer_arm(a, b, c) ets_timer_arm_new(a, b, c, 1)
                               ^
user/user_main.c:60:5: note: in expansion of macro 'os_timer_arm'
     os_timer_arm(&some_timer, 1000, 1);
     ^
user/user_main.c:63:5: error: implicit declaration of function 'system_os_task' [-Werror=implicit-function-declaration]
     system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_pr
     ^
cc1: all warnings being treated as errors
make: *** [build/user/user_main.o] Error 1


I have started with clean Lubuntu VM on several machines and all result in the same issue.
Has anyone seen this before and/or guide me into a direction to get this resolved?

Thanks all,
-Tiest
User avatar
By tomeko
#35008 I'm using Cherts kit on Windows. Some of the examples have "espmissingincludes.h" file with (according to comment guessed) missing declarations.
Alternatively you can add -Wno-implicit-function-declaration to compiler options.